An elegant way to define a sequenceAn elegant non-technical account on the work of Joseph Fourier. Numbers Made From Concatenating Prime FactorizationsNaive categorical question about prime numbers, primes, and irreduciblesTips for Prime Factorization of a Given Large IntergerAbout a Sequence of Prime Numbers inspired by the Green Tao TheoremAbout a sequence on Prime numbers.Longest sequence of primes where each term is obtained by appending a new digit to the previous termProof of existence of infinitely many primes that divide the sequence $S(k)=sum_i=1^n a_i^k$ where $a_i_i=1^n$ forms an APLongest sequence of consecutive integers which are not coprime with $n!$Some primes with a “special” property

Determining Impedance With An Antenna Analyzer

Would Slavery Reparations be considered Bills of Attainder and hence Illegal?

How do I gain back my faith in my PhD degree?

How to prevent "they're falling in love" trope

Alternative to sending password over mail?

What does the expression "A Mann!" means

Is there a hemisphere-neutral way of specifying a season?

Unable to supress ligatures in headings which are set in Caps

Why is this clock signal connected to a capacitor to gnd?

Why is it a bad idea to hire a hitman to eliminate most corrupt politicians?

Apex Framework / library for consuming REST services

ssTTsSTtRrriinInnnnNNNIiinngg

Is it acceptable for a professor to tell male students to not think that they are smarter than female students?

What does “the session was packed” mean in this context?

Are there any examples of a variable being normally distributed that is *not* due to the Central Limit Theorem?

Why was the shrinking from 8″ made only to 5.25″ and not smaller (4″ or less)?

How much of data wrangling is a data scientist's job?

One verb to replace 'be a member of' a club

Which is the best way to check return result?

What is the idiomatic way to say "clothing fits"?

Method Does Not Exist error message

What killed these X2 caps?

I would say: "You are another teacher", but she is a woman and I am a man

Venezuelan girlfriend wants to travel the USA to be with me. What is the process?



An elegant way to define a sequence


An elegant non-technical account on the work of Joseph Fourier. Numbers Made From Concatenating Prime FactorizationsNaive categorical question about prime numbers, primes, and irreduciblesTips for Prime Factorization of a Given Large IntergerAbout a Sequence of Prime Numbers inspired by the Green Tao TheoremAbout a sequence on Prime numbers.Longest sequence of primes where each term is obtained by appending a new digit to the previous termProof of existence of infinitely many primes that divide the sequence $S(k)=sum_i=1^n a_i^k$ where $a_i_i=1^n$ forms an APLongest sequence of consecutive integers which are not coprime with $n!$Some primes with a “special” property













4












$begingroup$


I am trying to define a sequence.
The first few terms of the sequence are:



$2,5,13,43,61$



Not yet found other terms because I am working with paper and pen, no software.



Why the first term is $5$?



Let be $pi(x)$ the celebrated prime counting function.
Well 5-$pi(5)$=$5-3$=2 which is a prime.
If we repeat the same thing with the new prime $2$, we have 2-$pi(2)=1$, which is not a prime. So starting the sequence from prime $5$, we have the cycle $5rightarrow 2rightarrow 1$. The arrows stop when a not prime is reached. No prime below $5$ has a longer cycle. Infact starting for example from $3$ you get $3-pi(3)=1$, which is not prime so the cycle is simply $3rightarrow 1$.
The second term of the sequence is $13$ because below $13$ no other prime has a larger cycle. Infact $13-pi(13)=7$, which is prime. Then $7-pi(7)=3$, which is prime and eventually $3-pi(3)=1$, which is not prime. So the cycle is $13rightarrow 7rightarrow 3rightarrow 1$



The cycle for 43 is longer so it is the third term of the above sequence.
Could you suggest to me a nice and elegant definition for this sequence: $5,13,43,61...$ (I don't know if it is infinite)
Could you find other terms with Pari if you want?










share|cite|improve this question











$endgroup$











  • $begingroup$
    @Barry Cipra any idea?
    $endgroup$
    – homunculus
    2 days ago










  • $begingroup$
    oeis.org/A147259
    $endgroup$
    – Don Thousand
    2 days ago










  • $begingroup$
    @Don Thousand are you sure is that?
    $endgroup$
    – homunculus
    2 days ago






  • 1




    $begingroup$
    The next terms in the sequence are $14897$ and $377942237 $.
    $endgroup$
    – Chip Hurst
    2 days ago






  • 2




    $begingroup$
    Chip Hurst record goes like this: $$377942237 mapsto 357721207 mapsto 338525531 mapsto 320305991 mapsto 303015169 mapsto 286608383 mapsto 271043027 mapsto 256278002$$
    $endgroup$
    – Jeppe Stig Nielsen
    2 days ago















4












$begingroup$


I am trying to define a sequence.
The first few terms of the sequence are:



$2,5,13,43,61$



Not yet found other terms because I am working with paper and pen, no software.



Why the first term is $5$?



Let be $pi(x)$ the celebrated prime counting function.
Well 5-$pi(5)$=$5-3$=2 which is a prime.
If we repeat the same thing with the new prime $2$, we have 2-$pi(2)=1$, which is not a prime. So starting the sequence from prime $5$, we have the cycle $5rightarrow 2rightarrow 1$. The arrows stop when a not prime is reached. No prime below $5$ has a longer cycle. Infact starting for example from $3$ you get $3-pi(3)=1$, which is not prime so the cycle is simply $3rightarrow 1$.
The second term of the sequence is $13$ because below $13$ no other prime has a larger cycle. Infact $13-pi(13)=7$, which is prime. Then $7-pi(7)=3$, which is prime and eventually $3-pi(3)=1$, which is not prime. So the cycle is $13rightarrow 7rightarrow 3rightarrow 1$



The cycle for 43 is longer so it is the third term of the above sequence.
Could you suggest to me a nice and elegant definition for this sequence: $5,13,43,61...$ (I don't know if it is infinite)
Could you find other terms with Pari if you want?










share|cite|improve this question











$endgroup$











  • $begingroup$
    @Barry Cipra any idea?
    $endgroup$
    – homunculus
    2 days ago










  • $begingroup$
    oeis.org/A147259
    $endgroup$
    – Don Thousand
    2 days ago










  • $begingroup$
    @Don Thousand are you sure is that?
    $endgroup$
    – homunculus
    2 days ago






  • 1




    $begingroup$
    The next terms in the sequence are $14897$ and $377942237 $.
    $endgroup$
    – Chip Hurst
    2 days ago






  • 2




    $begingroup$
    Chip Hurst record goes like this: $$377942237 mapsto 357721207 mapsto 338525531 mapsto 320305991 mapsto 303015169 mapsto 286608383 mapsto 271043027 mapsto 256278002$$
    $endgroup$
    – Jeppe Stig Nielsen
    2 days ago













4












4








4


1



$begingroup$


I am trying to define a sequence.
The first few terms of the sequence are:



$2,5,13,43,61$



Not yet found other terms because I am working with paper and pen, no software.



Why the first term is $5$?



Let be $pi(x)$ the celebrated prime counting function.
Well 5-$pi(5)$=$5-3$=2 which is a prime.
If we repeat the same thing with the new prime $2$, we have 2-$pi(2)=1$, which is not a prime. So starting the sequence from prime $5$, we have the cycle $5rightarrow 2rightarrow 1$. The arrows stop when a not prime is reached. No prime below $5$ has a longer cycle. Infact starting for example from $3$ you get $3-pi(3)=1$, which is not prime so the cycle is simply $3rightarrow 1$.
The second term of the sequence is $13$ because below $13$ no other prime has a larger cycle. Infact $13-pi(13)=7$, which is prime. Then $7-pi(7)=3$, which is prime and eventually $3-pi(3)=1$, which is not prime. So the cycle is $13rightarrow 7rightarrow 3rightarrow 1$



The cycle for 43 is longer so it is the third term of the above sequence.
Could you suggest to me a nice and elegant definition for this sequence: $5,13,43,61...$ (I don't know if it is infinite)
Could you find other terms with Pari if you want?










share|cite|improve this question











$endgroup$




I am trying to define a sequence.
The first few terms of the sequence are:



$2,5,13,43,61$



Not yet found other terms because I am working with paper and pen, no software.



Why the first term is $5$?



Let be $pi(x)$ the celebrated prime counting function.
Well 5-$pi(5)$=$5-3$=2 which is a prime.
If we repeat the same thing with the new prime $2$, we have 2-$pi(2)=1$, which is not a prime. So starting the sequence from prime $5$, we have the cycle $5rightarrow 2rightarrow 1$. The arrows stop when a not prime is reached. No prime below $5$ has a longer cycle. Infact starting for example from $3$ you get $3-pi(3)=1$, which is not prime so the cycle is simply $3rightarrow 1$.
The second term of the sequence is $13$ because below $13$ no other prime has a larger cycle. Infact $13-pi(13)=7$, which is prime. Then $7-pi(7)=3$, which is prime and eventually $3-pi(3)=1$, which is not prime. So the cycle is $13rightarrow 7rightarrow 3rightarrow 1$



The cycle for 43 is longer so it is the third term of the above sequence.
Could you suggest to me a nice and elegant definition for this sequence: $5,13,43,61...$ (I don't know if it is infinite)
Could you find other terms with Pari if you want?







number-theory






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited 2 days ago







homunculus

















asked 2 days ago









homunculushomunculus

1869




1869











  • $begingroup$
    @Barry Cipra any idea?
    $endgroup$
    – homunculus
    2 days ago










  • $begingroup$
    oeis.org/A147259
    $endgroup$
    – Don Thousand
    2 days ago










  • $begingroup$
    @Don Thousand are you sure is that?
    $endgroup$
    – homunculus
    2 days ago






  • 1




    $begingroup$
    The next terms in the sequence are $14897$ and $377942237 $.
    $endgroup$
    – Chip Hurst
    2 days ago






  • 2




    $begingroup$
    Chip Hurst record goes like this: $$377942237 mapsto 357721207 mapsto 338525531 mapsto 320305991 mapsto 303015169 mapsto 286608383 mapsto 271043027 mapsto 256278002$$
    $endgroup$
    – Jeppe Stig Nielsen
    2 days ago
















  • $begingroup$
    @Barry Cipra any idea?
    $endgroup$
    – homunculus
    2 days ago










  • $begingroup$
    oeis.org/A147259
    $endgroup$
    – Don Thousand
    2 days ago










  • $begingroup$
    @Don Thousand are you sure is that?
    $endgroup$
    – homunculus
    2 days ago






  • 1




    $begingroup$
    The next terms in the sequence are $14897$ and $377942237 $.
    $endgroup$
    – Chip Hurst
    2 days ago






  • 2




    $begingroup$
    Chip Hurst record goes like this: $$377942237 mapsto 357721207 mapsto 338525531 mapsto 320305991 mapsto 303015169 mapsto 286608383 mapsto 271043027 mapsto 256278002$$
    $endgroup$
    – Jeppe Stig Nielsen
    2 days ago















$begingroup$
@Barry Cipra any idea?
$endgroup$
– homunculus
2 days ago




$begingroup$
@Barry Cipra any idea?
$endgroup$
– homunculus
2 days ago












$begingroup$
oeis.org/A147259
$endgroup$
– Don Thousand
2 days ago




$begingroup$
oeis.org/A147259
$endgroup$
– Don Thousand
2 days ago












$begingroup$
@Don Thousand are you sure is that?
$endgroup$
– homunculus
2 days ago




$begingroup$
@Don Thousand are you sure is that?
$endgroup$
– homunculus
2 days ago




1




1




$begingroup$
The next terms in the sequence are $14897$ and $377942237 $.
$endgroup$
– Chip Hurst
2 days ago




$begingroup$
The next terms in the sequence are $14897$ and $377942237 $.
$endgroup$
– Chip Hurst
2 days ago




2




2




$begingroup$
Chip Hurst record goes like this: $$377942237 mapsto 357721207 mapsto 338525531 mapsto 320305991 mapsto 303015169 mapsto 286608383 mapsto 271043027 mapsto 256278002$$
$endgroup$
– Jeppe Stig Nielsen
2 days ago




$begingroup$
Chip Hurst record goes like this: $$377942237 mapsto 357721207 mapsto 338525531 mapsto 320305991 mapsto 303015169 mapsto 286608383 mapsto 271043027 mapsto 256278002$$
$endgroup$
– Jeppe Stig Nielsen
2 days ago










3 Answers
3






active

oldest

votes


















5












$begingroup$

I believe your sequence continues forever but grows quickly. If $n$ is large, the density of primes around $n$ is $log n$. Since $log n$ is so much smaller than $n$, the chance a random $n$ has $k$ arrows is about $frac 1(log n)^k+1$. The expected number of sequences of length $k$ above $10^12,$ say, is then $int_10^12^infty frac dn(log n)^k+1$. This diverges because $(log n)^k$ becomes less than $n$ for $n$ large enough and we know the integral of $frac 1n$ diverges. Each subtraction is only of order $frac nlog n$, which is small compared to $n$ and the log will not change much.



If we ask what length of sequence we expect to find among the $12$ digit numbers, we note that the log of these numbers is about $29$ and that $29^8.5 approx 3cdot 10^12$. We would expect to find some sequences of $7$ arrows, maybe $8$ or $9$, and be surprised at $10$ or more. For $100$ digit numbers, the log is about $231$ and $231^42.5 approx 3cdot 10^100$, so we would expect some sequences of length $40$ or $41$ among the $100$ digit numbers.






share|cite|improve this answer









$endgroup$












  • $begingroup$
    thanks but a way to define the sequence? I am still thinkig about an elegant way to define it?
    $endgroup$
    – homunculus
    2 days ago











  • $begingroup$
    You have defined it nicely. Given $n$, see how many steps of primes you get and call it $f(n)$. Your sequence are then new maxima of $f(n)$. I strongly doubt there is a way other than searching to find the sixth or tenth term.
    $endgroup$
    – Ross Millikan
    2 days ago










  • $begingroup$
    only even indexed primes after the first entry.
    $endgroup$
    – Roddy MacPhee
    2 days ago










  • $begingroup$
    @Ross Millikan but not all primes p ends the sequence with 1, isn't?
    $endgroup$
    – homunculus
    2 days ago










  • $begingroup$
    Formally, you can define your sequence like this: Let $phi$ be given by $$phi(p)=begincasesp-pi(p), & textif $p$ is prime\ textundefined, & textotherwiseendcases$$ For each prime $p$, let $f(p)$ denote the maximal number of times you can iterate $phi$ starting from $p$. For example $f(43)=4$ because we get the four-arrow chain $$43mapsto 29mapsto 19mapsto 11mapsto 6$$ and you cannot go on because $6$ is not prime. Then the sequence is defined as the $p$ for which $f(p)$ is record high. So a $p$ is in the sequence iff $f(p)$ is strictly greater than $f(q)$ for all $q<p$.
    $endgroup$
    – Jeppe Stig Nielsen
    2 days ago


















2












$begingroup$

`my(a=0,b=0);forprime(x=1,50000,y=x;while(isprime(y-primepi(y)),y-=primepi(y);b++);if(b>a,a=b;print(x));b=0)`


produces 14897 as the next one. Then no more below 500000. There's not too much to say except primes in the sequence will be primes at even indices after the first, simply because most primes are more than 2 away from their indices.






share|cite|improve this answer









$endgroup$












  • $begingroup$
    This supports my claim that they will grow rapidly. Thanks
    $endgroup$
    – Ross Millikan
    2 days ago










  • $begingroup$
    can we get it to support valuation of 2 for the index ? so far they are all valuation 1. If that continues checking only every 4th prime is possible.
    $endgroup$
    – Roddy MacPhee
    2 days ago










  • $begingroup$
    I note that your code has 50,000, but the text below has 500,000. Did you check it to 50,000 or 500,000?
    $endgroup$
    – Paul Sinclair
    2 days ago










  • $begingroup$
    The later (in fact tried as high as 700,000) but only after posting the code.
    $endgroup$
    – Roddy MacPhee
    2 days ago


















2












$begingroup$

Using $S$ to denote the sequence you're trying to define, one may do so in
terms of two auxiliary functions $N$ and $L$, where $N$ assigns to every prime number $x$ a sequence whose first term, denoted by $(N(x))(0)$$^*$, is $x$ itself, and each next term, denoted by $(N(x))(n + 1)$, is given by $(N(x))(n) - pi((N(x))(n))$, and $L$ is the function which gives the number of terms of a sequence returned by $N$ up to when the first non-prime term is reached. $S$ is then defined to be such that the first term equals $5$, and given any term $S(n)$, the next term in the sequence is then the smallest prime number $p$ such that $L(N(p)) > L(N(S(n)))$.



In formula:



$S(0) = 5$
$S(n + 1) = langledownarrow p : p in mathbbP : L(N(p)) > L(N(S(n)))rangle$



$(N(x))(0) = x$
$(N(x))(n + 1) = (N(x))(n) - pi((N(x))(n))$



$L(N(x)) = langledownarrow n : n in mathbbN : (N(x))(n) notin
mathbbPrangle$



The notation $langledownarrow x : R(x) : T(x)rangle$ here denotes the minimum element $x$ that satisfies $T(x)$ from the set of all elements satisfying $R(x)$. $R(x)$ and $T(x)$ denote arbitrary predicates (i. e. boolean-valued functions) which generally depend on $x$.




$^*$Note: Here we use the definition that a sequence is any function whose domain consists of either all natural numbers or all natural numbers $n$ such that $0 le n lt m$ for arbitrary natural constant $m$. We admit $0$ as the smallest natural number.






share|cite|improve this answer











$endgroup$












  • $begingroup$
    I have edited this answer many times already, but I think I'm done now. I have performed a major clean-up on it by leaving the precise delineation of the domains and codomains of $S$, $N(x)$ and $L$ unspecified, as that degree of overspecification is completely irrelevant to the problem.
    $endgroup$
    – lucasb
    23 hours ago











Your Answer





StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "69"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3170629%2fan-elegant-way-to-define-a-sequence%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























3 Answers
3






active

oldest

votes








3 Answers
3






active

oldest

votes









active

oldest

votes






active

oldest

votes









5












$begingroup$

I believe your sequence continues forever but grows quickly. If $n$ is large, the density of primes around $n$ is $log n$. Since $log n$ is so much smaller than $n$, the chance a random $n$ has $k$ arrows is about $frac 1(log n)^k+1$. The expected number of sequences of length $k$ above $10^12,$ say, is then $int_10^12^infty frac dn(log n)^k+1$. This diverges because $(log n)^k$ becomes less than $n$ for $n$ large enough and we know the integral of $frac 1n$ diverges. Each subtraction is only of order $frac nlog n$, which is small compared to $n$ and the log will not change much.



If we ask what length of sequence we expect to find among the $12$ digit numbers, we note that the log of these numbers is about $29$ and that $29^8.5 approx 3cdot 10^12$. We would expect to find some sequences of $7$ arrows, maybe $8$ or $9$, and be surprised at $10$ or more. For $100$ digit numbers, the log is about $231$ and $231^42.5 approx 3cdot 10^100$, so we would expect some sequences of length $40$ or $41$ among the $100$ digit numbers.






share|cite|improve this answer









$endgroup$












  • $begingroup$
    thanks but a way to define the sequence? I am still thinkig about an elegant way to define it?
    $endgroup$
    – homunculus
    2 days ago











  • $begingroup$
    You have defined it nicely. Given $n$, see how many steps of primes you get and call it $f(n)$. Your sequence are then new maxima of $f(n)$. I strongly doubt there is a way other than searching to find the sixth or tenth term.
    $endgroup$
    – Ross Millikan
    2 days ago










  • $begingroup$
    only even indexed primes after the first entry.
    $endgroup$
    – Roddy MacPhee
    2 days ago










  • $begingroup$
    @Ross Millikan but not all primes p ends the sequence with 1, isn't?
    $endgroup$
    – homunculus
    2 days ago










  • $begingroup$
    Formally, you can define your sequence like this: Let $phi$ be given by $$phi(p)=begincasesp-pi(p), & textif $p$ is prime\ textundefined, & textotherwiseendcases$$ For each prime $p$, let $f(p)$ denote the maximal number of times you can iterate $phi$ starting from $p$. For example $f(43)=4$ because we get the four-arrow chain $$43mapsto 29mapsto 19mapsto 11mapsto 6$$ and you cannot go on because $6$ is not prime. Then the sequence is defined as the $p$ for which $f(p)$ is record high. So a $p$ is in the sequence iff $f(p)$ is strictly greater than $f(q)$ for all $q<p$.
    $endgroup$
    – Jeppe Stig Nielsen
    2 days ago















5












$begingroup$

I believe your sequence continues forever but grows quickly. If $n$ is large, the density of primes around $n$ is $log n$. Since $log n$ is so much smaller than $n$, the chance a random $n$ has $k$ arrows is about $frac 1(log n)^k+1$. The expected number of sequences of length $k$ above $10^12,$ say, is then $int_10^12^infty frac dn(log n)^k+1$. This diverges because $(log n)^k$ becomes less than $n$ for $n$ large enough and we know the integral of $frac 1n$ diverges. Each subtraction is only of order $frac nlog n$, which is small compared to $n$ and the log will not change much.



If we ask what length of sequence we expect to find among the $12$ digit numbers, we note that the log of these numbers is about $29$ and that $29^8.5 approx 3cdot 10^12$. We would expect to find some sequences of $7$ arrows, maybe $8$ or $9$, and be surprised at $10$ or more. For $100$ digit numbers, the log is about $231$ and $231^42.5 approx 3cdot 10^100$, so we would expect some sequences of length $40$ or $41$ among the $100$ digit numbers.






share|cite|improve this answer









$endgroup$












  • $begingroup$
    thanks but a way to define the sequence? I am still thinkig about an elegant way to define it?
    $endgroup$
    – homunculus
    2 days ago











  • $begingroup$
    You have defined it nicely. Given $n$, see how many steps of primes you get and call it $f(n)$. Your sequence are then new maxima of $f(n)$. I strongly doubt there is a way other than searching to find the sixth or tenth term.
    $endgroup$
    – Ross Millikan
    2 days ago










  • $begingroup$
    only even indexed primes after the first entry.
    $endgroup$
    – Roddy MacPhee
    2 days ago










  • $begingroup$
    @Ross Millikan but not all primes p ends the sequence with 1, isn't?
    $endgroup$
    – homunculus
    2 days ago










  • $begingroup$
    Formally, you can define your sequence like this: Let $phi$ be given by $$phi(p)=begincasesp-pi(p), & textif $p$ is prime\ textundefined, & textotherwiseendcases$$ For each prime $p$, let $f(p)$ denote the maximal number of times you can iterate $phi$ starting from $p$. For example $f(43)=4$ because we get the four-arrow chain $$43mapsto 29mapsto 19mapsto 11mapsto 6$$ and you cannot go on because $6$ is not prime. Then the sequence is defined as the $p$ for which $f(p)$ is record high. So a $p$ is in the sequence iff $f(p)$ is strictly greater than $f(q)$ for all $q<p$.
    $endgroup$
    – Jeppe Stig Nielsen
    2 days ago













5












5








5





$begingroup$

I believe your sequence continues forever but grows quickly. If $n$ is large, the density of primes around $n$ is $log n$. Since $log n$ is so much smaller than $n$, the chance a random $n$ has $k$ arrows is about $frac 1(log n)^k+1$. The expected number of sequences of length $k$ above $10^12,$ say, is then $int_10^12^infty frac dn(log n)^k+1$. This diverges because $(log n)^k$ becomes less than $n$ for $n$ large enough and we know the integral of $frac 1n$ diverges. Each subtraction is only of order $frac nlog n$, which is small compared to $n$ and the log will not change much.



If we ask what length of sequence we expect to find among the $12$ digit numbers, we note that the log of these numbers is about $29$ and that $29^8.5 approx 3cdot 10^12$. We would expect to find some sequences of $7$ arrows, maybe $8$ or $9$, and be surprised at $10$ or more. For $100$ digit numbers, the log is about $231$ and $231^42.5 approx 3cdot 10^100$, so we would expect some sequences of length $40$ or $41$ among the $100$ digit numbers.






share|cite|improve this answer









$endgroup$



I believe your sequence continues forever but grows quickly. If $n$ is large, the density of primes around $n$ is $log n$. Since $log n$ is so much smaller than $n$, the chance a random $n$ has $k$ arrows is about $frac 1(log n)^k+1$. The expected number of sequences of length $k$ above $10^12,$ say, is then $int_10^12^infty frac dn(log n)^k+1$. This diverges because $(log n)^k$ becomes less than $n$ for $n$ large enough and we know the integral of $frac 1n$ diverges. Each subtraction is only of order $frac nlog n$, which is small compared to $n$ and the log will not change much.



If we ask what length of sequence we expect to find among the $12$ digit numbers, we note that the log of these numbers is about $29$ and that $29^8.5 approx 3cdot 10^12$. We would expect to find some sequences of $7$ arrows, maybe $8$ or $9$, and be surprised at $10$ or more. For $100$ digit numbers, the log is about $231$ and $231^42.5 approx 3cdot 10^100$, so we would expect some sequences of length $40$ or $41$ among the $100$ digit numbers.







share|cite|improve this answer












share|cite|improve this answer



share|cite|improve this answer










answered 2 days ago









Ross MillikanRoss Millikan

301k24200375




301k24200375











  • $begingroup$
    thanks but a way to define the sequence? I am still thinkig about an elegant way to define it?
    $endgroup$
    – homunculus
    2 days ago











  • $begingroup$
    You have defined it nicely. Given $n$, see how many steps of primes you get and call it $f(n)$. Your sequence are then new maxima of $f(n)$. I strongly doubt there is a way other than searching to find the sixth or tenth term.
    $endgroup$
    – Ross Millikan
    2 days ago










  • $begingroup$
    only even indexed primes after the first entry.
    $endgroup$
    – Roddy MacPhee
    2 days ago










  • $begingroup$
    @Ross Millikan but not all primes p ends the sequence with 1, isn't?
    $endgroup$
    – homunculus
    2 days ago










  • $begingroup$
    Formally, you can define your sequence like this: Let $phi$ be given by $$phi(p)=begincasesp-pi(p), & textif $p$ is prime\ textundefined, & textotherwiseendcases$$ For each prime $p$, let $f(p)$ denote the maximal number of times you can iterate $phi$ starting from $p$. For example $f(43)=4$ because we get the four-arrow chain $$43mapsto 29mapsto 19mapsto 11mapsto 6$$ and you cannot go on because $6$ is not prime. Then the sequence is defined as the $p$ for which $f(p)$ is record high. So a $p$ is in the sequence iff $f(p)$ is strictly greater than $f(q)$ for all $q<p$.
    $endgroup$
    – Jeppe Stig Nielsen
    2 days ago
















  • $begingroup$
    thanks but a way to define the sequence? I am still thinkig about an elegant way to define it?
    $endgroup$
    – homunculus
    2 days ago











  • $begingroup$
    You have defined it nicely. Given $n$, see how many steps of primes you get and call it $f(n)$. Your sequence are then new maxima of $f(n)$. I strongly doubt there is a way other than searching to find the sixth or tenth term.
    $endgroup$
    – Ross Millikan
    2 days ago










  • $begingroup$
    only even indexed primes after the first entry.
    $endgroup$
    – Roddy MacPhee
    2 days ago










  • $begingroup$
    @Ross Millikan but not all primes p ends the sequence with 1, isn't?
    $endgroup$
    – homunculus
    2 days ago










  • $begingroup$
    Formally, you can define your sequence like this: Let $phi$ be given by $$phi(p)=begincasesp-pi(p), & textif $p$ is prime\ textundefined, & textotherwiseendcases$$ For each prime $p$, let $f(p)$ denote the maximal number of times you can iterate $phi$ starting from $p$. For example $f(43)=4$ because we get the four-arrow chain $$43mapsto 29mapsto 19mapsto 11mapsto 6$$ and you cannot go on because $6$ is not prime. Then the sequence is defined as the $p$ for which $f(p)$ is record high. So a $p$ is in the sequence iff $f(p)$ is strictly greater than $f(q)$ for all $q<p$.
    $endgroup$
    – Jeppe Stig Nielsen
    2 days ago















$begingroup$
thanks but a way to define the sequence? I am still thinkig about an elegant way to define it?
$endgroup$
– homunculus
2 days ago





$begingroup$
thanks but a way to define the sequence? I am still thinkig about an elegant way to define it?
$endgroup$
– homunculus
2 days ago













$begingroup$
You have defined it nicely. Given $n$, see how many steps of primes you get and call it $f(n)$. Your sequence are then new maxima of $f(n)$. I strongly doubt there is a way other than searching to find the sixth or tenth term.
$endgroup$
– Ross Millikan
2 days ago




$begingroup$
You have defined it nicely. Given $n$, see how many steps of primes you get and call it $f(n)$. Your sequence are then new maxima of $f(n)$. I strongly doubt there is a way other than searching to find the sixth or tenth term.
$endgroup$
– Ross Millikan
2 days ago












$begingroup$
only even indexed primes after the first entry.
$endgroup$
– Roddy MacPhee
2 days ago




$begingroup$
only even indexed primes after the first entry.
$endgroup$
– Roddy MacPhee
2 days ago












$begingroup$
@Ross Millikan but not all primes p ends the sequence with 1, isn't?
$endgroup$
– homunculus
2 days ago




$begingroup$
@Ross Millikan but not all primes p ends the sequence with 1, isn't?
$endgroup$
– homunculus
2 days ago












$begingroup$
Formally, you can define your sequence like this: Let $phi$ be given by $$phi(p)=begincasesp-pi(p), & textif $p$ is prime\ textundefined, & textotherwiseendcases$$ For each prime $p$, let $f(p)$ denote the maximal number of times you can iterate $phi$ starting from $p$. For example $f(43)=4$ because we get the four-arrow chain $$43mapsto 29mapsto 19mapsto 11mapsto 6$$ and you cannot go on because $6$ is not prime. Then the sequence is defined as the $p$ for which $f(p)$ is record high. So a $p$ is in the sequence iff $f(p)$ is strictly greater than $f(q)$ for all $q<p$.
$endgroup$
– Jeppe Stig Nielsen
2 days ago




$begingroup$
Formally, you can define your sequence like this: Let $phi$ be given by $$phi(p)=begincasesp-pi(p), & textif $p$ is prime\ textundefined, & textotherwiseendcases$$ For each prime $p$, let $f(p)$ denote the maximal number of times you can iterate $phi$ starting from $p$. For example $f(43)=4$ because we get the four-arrow chain $$43mapsto 29mapsto 19mapsto 11mapsto 6$$ and you cannot go on because $6$ is not prime. Then the sequence is defined as the $p$ for which $f(p)$ is record high. So a $p$ is in the sequence iff $f(p)$ is strictly greater than $f(q)$ for all $q<p$.
$endgroup$
– Jeppe Stig Nielsen
2 days ago











2












$begingroup$

`my(a=0,b=0);forprime(x=1,50000,y=x;while(isprime(y-primepi(y)),y-=primepi(y);b++);if(b>a,a=b;print(x));b=0)`


produces 14897 as the next one. Then no more below 500000. There's not too much to say except primes in the sequence will be primes at even indices after the first, simply because most primes are more than 2 away from their indices.






share|cite|improve this answer









$endgroup$












  • $begingroup$
    This supports my claim that they will grow rapidly. Thanks
    $endgroup$
    – Ross Millikan
    2 days ago










  • $begingroup$
    can we get it to support valuation of 2 for the index ? so far they are all valuation 1. If that continues checking only every 4th prime is possible.
    $endgroup$
    – Roddy MacPhee
    2 days ago










  • $begingroup$
    I note that your code has 50,000, but the text below has 500,000. Did you check it to 50,000 or 500,000?
    $endgroup$
    – Paul Sinclair
    2 days ago










  • $begingroup$
    The later (in fact tried as high as 700,000) but only after posting the code.
    $endgroup$
    – Roddy MacPhee
    2 days ago















2












$begingroup$

`my(a=0,b=0);forprime(x=1,50000,y=x;while(isprime(y-primepi(y)),y-=primepi(y);b++);if(b>a,a=b;print(x));b=0)`


produces 14897 as the next one. Then no more below 500000. There's not too much to say except primes in the sequence will be primes at even indices after the first, simply because most primes are more than 2 away from their indices.






share|cite|improve this answer









$endgroup$












  • $begingroup$
    This supports my claim that they will grow rapidly. Thanks
    $endgroup$
    – Ross Millikan
    2 days ago










  • $begingroup$
    can we get it to support valuation of 2 for the index ? so far they are all valuation 1. If that continues checking only every 4th prime is possible.
    $endgroup$
    – Roddy MacPhee
    2 days ago










  • $begingroup$
    I note that your code has 50,000, but the text below has 500,000. Did you check it to 50,000 or 500,000?
    $endgroup$
    – Paul Sinclair
    2 days ago










  • $begingroup$
    The later (in fact tried as high as 700,000) but only after posting the code.
    $endgroup$
    – Roddy MacPhee
    2 days ago













2












2








2





$begingroup$

`my(a=0,b=0);forprime(x=1,50000,y=x;while(isprime(y-primepi(y)),y-=primepi(y);b++);if(b>a,a=b;print(x));b=0)`


produces 14897 as the next one. Then no more below 500000. There's not too much to say except primes in the sequence will be primes at even indices after the first, simply because most primes are more than 2 away from their indices.






share|cite|improve this answer









$endgroup$



`my(a=0,b=0);forprime(x=1,50000,y=x;while(isprime(y-primepi(y)),y-=primepi(y);b++);if(b>a,a=b;print(x));b=0)`


produces 14897 as the next one. Then no more below 500000. There's not too much to say except primes in the sequence will be primes at even indices after the first, simply because most primes are more than 2 away from their indices.







share|cite|improve this answer












share|cite|improve this answer



share|cite|improve this answer










answered 2 days ago









Roddy MacPheeRoddy MacPhee

642118




642118











  • $begingroup$
    This supports my claim that they will grow rapidly. Thanks
    $endgroup$
    – Ross Millikan
    2 days ago










  • $begingroup$
    can we get it to support valuation of 2 for the index ? so far they are all valuation 1. If that continues checking only every 4th prime is possible.
    $endgroup$
    – Roddy MacPhee
    2 days ago










  • $begingroup$
    I note that your code has 50,000, but the text below has 500,000. Did you check it to 50,000 or 500,000?
    $endgroup$
    – Paul Sinclair
    2 days ago










  • $begingroup$
    The later (in fact tried as high as 700,000) but only after posting the code.
    $endgroup$
    – Roddy MacPhee
    2 days ago
















  • $begingroup$
    This supports my claim that they will grow rapidly. Thanks
    $endgroup$
    – Ross Millikan
    2 days ago










  • $begingroup$
    can we get it to support valuation of 2 for the index ? so far they are all valuation 1. If that continues checking only every 4th prime is possible.
    $endgroup$
    – Roddy MacPhee
    2 days ago










  • $begingroup$
    I note that your code has 50,000, but the text below has 500,000. Did you check it to 50,000 or 500,000?
    $endgroup$
    – Paul Sinclair
    2 days ago










  • $begingroup$
    The later (in fact tried as high as 700,000) but only after posting the code.
    $endgroup$
    – Roddy MacPhee
    2 days ago















$begingroup$
This supports my claim that they will grow rapidly. Thanks
$endgroup$
– Ross Millikan
2 days ago




$begingroup$
This supports my claim that they will grow rapidly. Thanks
$endgroup$
– Ross Millikan
2 days ago












$begingroup$
can we get it to support valuation of 2 for the index ? so far they are all valuation 1. If that continues checking only every 4th prime is possible.
$endgroup$
– Roddy MacPhee
2 days ago




$begingroup$
can we get it to support valuation of 2 for the index ? so far they are all valuation 1. If that continues checking only every 4th prime is possible.
$endgroup$
– Roddy MacPhee
2 days ago












$begingroup$
I note that your code has 50,000, but the text below has 500,000. Did you check it to 50,000 or 500,000?
$endgroup$
– Paul Sinclair
2 days ago




$begingroup$
I note that your code has 50,000, but the text below has 500,000. Did you check it to 50,000 or 500,000?
$endgroup$
– Paul Sinclair
2 days ago












$begingroup$
The later (in fact tried as high as 700,000) but only after posting the code.
$endgroup$
– Roddy MacPhee
2 days ago




$begingroup$
The later (in fact tried as high as 700,000) but only after posting the code.
$endgroup$
– Roddy MacPhee
2 days ago











2












$begingroup$

Using $S$ to denote the sequence you're trying to define, one may do so in
terms of two auxiliary functions $N$ and $L$, where $N$ assigns to every prime number $x$ a sequence whose first term, denoted by $(N(x))(0)$$^*$, is $x$ itself, and each next term, denoted by $(N(x))(n + 1)$, is given by $(N(x))(n) - pi((N(x))(n))$, and $L$ is the function which gives the number of terms of a sequence returned by $N$ up to when the first non-prime term is reached. $S$ is then defined to be such that the first term equals $5$, and given any term $S(n)$, the next term in the sequence is then the smallest prime number $p$ such that $L(N(p)) > L(N(S(n)))$.



In formula:



$S(0) = 5$
$S(n + 1) = langledownarrow p : p in mathbbP : L(N(p)) > L(N(S(n)))rangle$



$(N(x))(0) = x$
$(N(x))(n + 1) = (N(x))(n) - pi((N(x))(n))$



$L(N(x)) = langledownarrow n : n in mathbbN : (N(x))(n) notin
mathbbPrangle$



The notation $langledownarrow x : R(x) : T(x)rangle$ here denotes the minimum element $x$ that satisfies $T(x)$ from the set of all elements satisfying $R(x)$. $R(x)$ and $T(x)$ denote arbitrary predicates (i. e. boolean-valued functions) which generally depend on $x$.




$^*$Note: Here we use the definition that a sequence is any function whose domain consists of either all natural numbers or all natural numbers $n$ such that $0 le n lt m$ for arbitrary natural constant $m$. We admit $0$ as the smallest natural number.






share|cite|improve this answer











$endgroup$












  • $begingroup$
    I have edited this answer many times already, but I think I'm done now. I have performed a major clean-up on it by leaving the precise delineation of the domains and codomains of $S$, $N(x)$ and $L$ unspecified, as that degree of overspecification is completely irrelevant to the problem.
    $endgroup$
    – lucasb
    23 hours ago















2












$begingroup$

Using $S$ to denote the sequence you're trying to define, one may do so in
terms of two auxiliary functions $N$ and $L$, where $N$ assigns to every prime number $x$ a sequence whose first term, denoted by $(N(x))(0)$$^*$, is $x$ itself, and each next term, denoted by $(N(x))(n + 1)$, is given by $(N(x))(n) - pi((N(x))(n))$, and $L$ is the function which gives the number of terms of a sequence returned by $N$ up to when the first non-prime term is reached. $S$ is then defined to be such that the first term equals $5$, and given any term $S(n)$, the next term in the sequence is then the smallest prime number $p$ such that $L(N(p)) > L(N(S(n)))$.



In formula:



$S(0) = 5$
$S(n + 1) = langledownarrow p : p in mathbbP : L(N(p)) > L(N(S(n)))rangle$



$(N(x))(0) = x$
$(N(x))(n + 1) = (N(x))(n) - pi((N(x))(n))$



$L(N(x)) = langledownarrow n : n in mathbbN : (N(x))(n) notin
mathbbPrangle$



The notation $langledownarrow x : R(x) : T(x)rangle$ here denotes the minimum element $x$ that satisfies $T(x)$ from the set of all elements satisfying $R(x)$. $R(x)$ and $T(x)$ denote arbitrary predicates (i. e. boolean-valued functions) which generally depend on $x$.




$^*$Note: Here we use the definition that a sequence is any function whose domain consists of either all natural numbers or all natural numbers $n$ such that $0 le n lt m$ for arbitrary natural constant $m$. We admit $0$ as the smallest natural number.






share|cite|improve this answer











$endgroup$












  • $begingroup$
    I have edited this answer many times already, but I think I'm done now. I have performed a major clean-up on it by leaving the precise delineation of the domains and codomains of $S$, $N(x)$ and $L$ unspecified, as that degree of overspecification is completely irrelevant to the problem.
    $endgroup$
    – lucasb
    23 hours ago













2












2








2





$begingroup$

Using $S$ to denote the sequence you're trying to define, one may do so in
terms of two auxiliary functions $N$ and $L$, where $N$ assigns to every prime number $x$ a sequence whose first term, denoted by $(N(x))(0)$$^*$, is $x$ itself, and each next term, denoted by $(N(x))(n + 1)$, is given by $(N(x))(n) - pi((N(x))(n))$, and $L$ is the function which gives the number of terms of a sequence returned by $N$ up to when the first non-prime term is reached. $S$ is then defined to be such that the first term equals $5$, and given any term $S(n)$, the next term in the sequence is then the smallest prime number $p$ such that $L(N(p)) > L(N(S(n)))$.



In formula:



$S(0) = 5$
$S(n + 1) = langledownarrow p : p in mathbbP : L(N(p)) > L(N(S(n)))rangle$



$(N(x))(0) = x$
$(N(x))(n + 1) = (N(x))(n) - pi((N(x))(n))$



$L(N(x)) = langledownarrow n : n in mathbbN : (N(x))(n) notin
mathbbPrangle$



The notation $langledownarrow x : R(x) : T(x)rangle$ here denotes the minimum element $x$ that satisfies $T(x)$ from the set of all elements satisfying $R(x)$. $R(x)$ and $T(x)$ denote arbitrary predicates (i. e. boolean-valued functions) which generally depend on $x$.




$^*$Note: Here we use the definition that a sequence is any function whose domain consists of either all natural numbers or all natural numbers $n$ such that $0 le n lt m$ for arbitrary natural constant $m$. We admit $0$ as the smallest natural number.






share|cite|improve this answer











$endgroup$



Using $S$ to denote the sequence you're trying to define, one may do so in
terms of two auxiliary functions $N$ and $L$, where $N$ assigns to every prime number $x$ a sequence whose first term, denoted by $(N(x))(0)$$^*$, is $x$ itself, and each next term, denoted by $(N(x))(n + 1)$, is given by $(N(x))(n) - pi((N(x))(n))$, and $L$ is the function which gives the number of terms of a sequence returned by $N$ up to when the first non-prime term is reached. $S$ is then defined to be such that the first term equals $5$, and given any term $S(n)$, the next term in the sequence is then the smallest prime number $p$ such that $L(N(p)) > L(N(S(n)))$.



In formula:



$S(0) = 5$
$S(n + 1) = langledownarrow p : p in mathbbP : L(N(p)) > L(N(S(n)))rangle$



$(N(x))(0) = x$
$(N(x))(n + 1) = (N(x))(n) - pi((N(x))(n))$



$L(N(x)) = langledownarrow n : n in mathbbN : (N(x))(n) notin
mathbbPrangle$



The notation $langledownarrow x : R(x) : T(x)rangle$ here denotes the minimum element $x$ that satisfies $T(x)$ from the set of all elements satisfying $R(x)$. $R(x)$ and $T(x)$ denote arbitrary predicates (i. e. boolean-valued functions) which generally depend on $x$.




$^*$Note: Here we use the definition that a sequence is any function whose domain consists of either all natural numbers or all natural numbers $n$ such that $0 le n lt m$ for arbitrary natural constant $m$. We admit $0$ as the smallest natural number.







share|cite|improve this answer














share|cite|improve this answer



share|cite|improve this answer








edited 23 hours ago

























answered 2 days ago









lucasblucasb

212




212











  • $begingroup$
    I have edited this answer many times already, but I think I'm done now. I have performed a major clean-up on it by leaving the precise delineation of the domains and codomains of $S$, $N(x)$ and $L$ unspecified, as that degree of overspecification is completely irrelevant to the problem.
    $endgroup$
    – lucasb
    23 hours ago
















  • $begingroup$
    I have edited this answer many times already, but I think I'm done now. I have performed a major clean-up on it by leaving the precise delineation of the domains and codomains of $S$, $N(x)$ and $L$ unspecified, as that degree of overspecification is completely irrelevant to the problem.
    $endgroup$
    – lucasb
    23 hours ago















$begingroup$
I have edited this answer many times already, but I think I'm done now. I have performed a major clean-up on it by leaving the precise delineation of the domains and codomains of $S$, $N(x)$ and $L$ unspecified, as that degree of overspecification is completely irrelevant to the problem.
$endgroup$
– lucasb
23 hours ago




$begingroup$
I have edited this answer many times already, but I think I'm done now. I have performed a major clean-up on it by leaving the precise delineation of the domains and codomains of $S$, $N(x)$ and $L$ unspecified, as that degree of overspecification is completely irrelevant to the problem.
$endgroup$
– lucasb
23 hours ago

















draft saved

draft discarded
















































Thanks for contributing an answer to Mathematics Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3170629%2fan-elegant-way-to-define-a-sequence%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Wikipedia:Vital articles Мазмуну Biography - Өмүр баян Philosophy and psychology - Философия жана психология Religion - Дин Social sciences - Коомдук илимдер Language and literature - Тил жана адабият Science - Илим Technology - Технология Arts and recreation - Искусство жана эс алуу History and geography - Тарых жана география Навигация менюсу

Bruxelas-Capital Índice Historia | Composición | Situación lingüística | Clima | Cidades irmandadas | Notas | Véxase tamén | Menú de navegacióneO uso das linguas en Bruxelas e a situación do neerlandés"Rexión de Bruxelas Capital"o orixinalSitio da rexiónPáxina de Bruselas no sitio da Oficina de Promoción Turística de Valonia e BruxelasMapa Interactivo da Rexión de Bruxelas-CapitaleeWorldCat332144929079854441105155190212ID28008674080552-90000 0001 0666 3698n94104302ID540940339365017018237

What should I write in an apology letter, since I have decided not to join a company after accepting an offer letterShould I keep looking after accepting a job offer?What should I do when I've been verbally told I would get an offer letter, but still haven't gotten one after 4 weeks?Do I accept an offer from a company that I am not likely to join?New job hasn't confirmed starting date and I want to give current employer as much notice as possibleHow should I address my manager in my resignation letter?HR delayed background verification, now jobless as resignedNo email communication after accepting a formal written offer. How should I phrase the call?What should I do if after receiving a verbal offer letter I am informed that my written job offer is put on hold due to some internal issues?Should I inform the current employer that I am about to resign within 1-2 weeks since I have signed the offer letter and waiting for visa?What company will do, if I send their offer letter to another company