cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-3 of 3 results.

A268497 Records in A268630 (= a(n)^2+a(n+1) is prime).

Original entry on oeis.org

0, 2, 4, 8, 10, 16, 18, 23, 28, 32, 37, 48, 63, 66, 73, 76, 79, 82, 99, 100, 102, 106, 109, 126, 142, 147, 169, 172, 177, 178, 189, 190, 198, 201, 205, 208, 217, 225, 226, 228, 232, 235, 244, 253, 258, 264, 268, 278, 288, 306, 333, 336, 343, 348, 352, 358, 361, 370, 379, 382
Offset: 0

Views

Author

M. F. Hasler, Feb 09 2016

Keywords

Comments

See A268496 for the corresponding indices, A268494-A268495 for "late birds". We use offset 0 here because the first term has a special status (it's not really "late") and also because all related sequences (A268630 and A268494 - A268497) have a(0)=0 and omitting this term yields the corresponding "positive integer" variant.

Programs

  • PARI
    show(n, f="/tmp/b268497.txt", c=0, a=0, u=[a-1])={for(n=1, n, a>=u[#u]&&if(f, write(f, c++-1, " "a), print1(a", ")); u=setunion(u, [a]); while(#u>1&&u[2]==u[1]+1, u=u[^1]); for(k=u[1]+1, 9e9, !setsearch(u, k) && isprime(a*a+k) && (a=k) && break))}

A268630 a(n)^2 + a(n+1) is prime; lexicographically earliest sequence of nonnegative integers with this property and containing no duplicates.

Original entry on oeis.org

0, 2, 1, 4, 3, 8, 7, 10, 9, 16, 13, 12, 5, 6, 11, 18, 23, 28, 25, 22, 15, 14, 27, 32, 37, 30, 19, 36, 31, 48, 29, 40, 21, 20, 33, 34, 45, 38, 39, 46, 63, 44, 43, 24, 17, 42, 47, 58, 49, 66, 35, 52, 73, 64, 57, 50, 51, 56, 55, 54, 41, 60, 59, 76, 67, 72, 53, 70, 69, 26, 75, 68, 79, 82, 99, 86, 61, 100, 91, 88, 85, 84, 65, 102, 83, 78, 89, 90, 71, 106, 81
Offset: 0

Views

Author

Eric Angelini and M. F. Hasler, Feb 09 2016

Keywords

Comments

Conjectured to be a permutation of the nonnegative integers.
Terms are of alternating parity.
The sequence cannot have a fixed point other than a(0)=0 because for n>0, the terms are of parity opposite to that of their indices.
The number of distinct m-digit primes arising from the sequence appears to be bounded by the entries of A030186. The counts here for m=1 to 9 are 2,7,21,69,216,684,2162,6801,21623 compared to A030186's 2,7,22,71,228,733,2356,7573,24342. - Bill McEachen, Feb 15 2016

Crossrefs

Cf. A268494, A268495, A268496, A268497 for records and late birds.

Programs

  • Mathematica
    s = {0, 2, 1, 4}; a = 4; Do[b = Mod[a, 2] + 3; While[MemberQ[s, b] || ! PrimeQ[a^2 + b], b = b + 2]; AppendTo[s, b]; a = b, {1000}]; s (* Zak Seidov, Feb 09 2016 *)
  • PARI
    {u=[a=0]; for(n=1, 99, for(k=1, 9e9, setsearch(u,k)&&next; isprime(a*a+k)||next; print1(k","); u=setunion(u,[a=k]); break))}

A268495 "Late birds" (a(n)n) in A268630 (= a(n)^2+a(n+1) is prime).

Original entry on oeis.org

0, 1, 3, 5, 6, 11, 14, 17, 26, 61, 62, 74, 77, 80, 101, 179, 191, 206, 209, 212, 269, 329, 341, 383, 401, 404, 425, 455, 458, 461, 467, 491, 557, 560, 581, 605, 614, 668, 680, 731, 734, 824, 869, 875, 890, 893, 911, 923, 935, 944, 959, 1031, 1064, 1097, 1118, 1130, 1151, 1154, 1316, 1322, 1328, 1349
Offset: 0

Views

Author

M. F. Hasler, Feb 09 2016

Keywords

Comments

See A268494 for the corresponding indices, A268496-A268497 for records. We use offset 0 here because the first term has a special status (it's not really "late") and also because all related sequences (A268630 and A268494 - A268497) have a(0)=0 and omitting this term yields the corresponding "positive integer" variant.
Assuming that A268630 is a permutation of the nonnegative integers N (as conjectured), the characterization given in the name is equivalent to say that a(n) equals the least number not occurring earlier. The sequence defined that way is finite if and only if A268630 is not a permutation of N.

Programs

  • PARI
    show(n,f="/tmp/b268495.txt",c=0,a=0,u=[a-1])={for(n=1, n, a==u[1]+1&&if(f,write(f,c++-1," "a),print1(a",")); u=setunion(u,[a]); while(#u>1&&u[2]==u[1]+1,u=u[^1]); for(k=u[1]+1, 9e9, !setsearch(u, k) && isprime(a*a+k) && (a=k) && break))}
Showing 1-3 of 3 results.