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-5 of 5 results.

A277487 a(n) = number of primes encountered before reaching (n^2)-1 when starting from k = ((n+1)^2)-1 and iterating map k -> k - A002828(k).

Original entry on oeis.org

1, 0, 1, 0, 0, 1, 2, 1, 1, 0, 2, 1, 2, 0, 3, 2, 0, 3, 0, 2, 0, 1, 4, 2, 3, 2, 4, 2, 0, 3, 3, 2, 5, 3, 4, 3, 3, 3, 2, 4, 2, 2, 4, 3, 3, 3, 6, 3, 1, 3, 4, 2, 6, 3, 3, 2, 5, 5, 5, 5, 4, 3, 7, 4, 4, 6, 4, 2, 4, 6, 5, 5, 5, 4, 7, 4, 4, 7, 4, 0, 5, 6, 7, 4, 4, 9, 4, 5, 2, 6, 6, 7, 11, 3, 6, 4, 9, 5, 7, 7, 7, 6, 8, 8, 7, 6, 4, 6, 5, 7, 8, 5, 9, 8, 8, 5, 12, 7, 5, 6
Offset: 1

Views

Author

Antti Karttunen, Nov 08 2016

Keywords

Comments

Number of primes on row n of A276574, after the initial zero-row.
Note how for the most n in range 1..10000, a(n) < A277486(n), even though for the most n in the same range A277890(n) < A277891(n). In range n=1..10000, there are only 209 cases where a(n) >= A277486(n).
On the other hand, when a(n) is compared to A277488(n), there is no such marked bias.

Examples

			For n=3, starting from k = ((3+1)^2)-1, and iterating k -> A255131(k), yields 15 -> 11 -> 8, where the iteration stops as the next lower number one less than a square has been reached. Of these numbers only 11 is a prime, thus a(3) = 1.
		

Crossrefs

Programs

  • PARI
    istwo(n:int)=my(f); if(n<3, return(n>=0); ); f=factor(n>>valuation(n, 2)); for(i=1, #f[, 1], if(bitand(f[i, 2], 1)==1&&bitand(f[i, 1], 3)==3, return(0))); 1
    isthree(n:int)=my(tmp=valuation(n, 2)); bitand(tmp, 1)||bitand(n>>tmp, 7)!=7
    A002828(n)=if(issquare(n), !!n, if(istwo(n), 2, 4-isthree(n))) \\ From Charles R Greathouse IV, Jul 19 2011
    A277487(n) = { my(orgk = ((n+1)^2)-1); my(k = orgk, s = 0); while(((k == orgk) || !issquare(1+k)), s = s + if(isprime(k),1,0); k = k - A002828(k)); s; };
    for(n=1, 10000, write("b277487.txt", n, " ", A277487(n)));
    
  • Scheme
    (define (A277487 n) (let ((org_k (- (A000290 (+ 1 n)) 1))) (let loop ((k org_k) (s 0)) (if (and (< k org_k) (= 1 (A010052 (+ 1 k)))) s (loop (- k (A002828 k)) (+ s (A010051 k)))))))

Formula

a(n) <= A277891(n).

A277888 Primes in A276573, the infinite trunk of least squares beanstalk.

Original entry on oeis.org

3, 11, 43, 53, 59, 67, 83, 131, 139, 149, 173, 179, 227, 233, 251, 277, 283, 331, 347, 349, 419, 431, 491, 547, 557, 563, 571, 587, 617, 643, 659, 661, 683, 701, 733, 739, 743, 757, 821, 827, 907, 941, 947, 971, 1013, 1019, 1051, 1061, 1091, 1109, 1117, 1123, 1129, 1163, 1187, 1213, 1229, 1259, 1283, 1291, 1301, 1307, 1327, 1373, 1427, 1429, 1451, 1453
Offset: 1

Views

Author

Antti Karttunen, Nov 13 2016

Keywords

Crossrefs

Intersection of A000040 and A276573.

Programs

Formula

a(n) = A276573(A277887(n)).

A277887 Positions of primes in A276573, the infinite trunk of least squares beanstalk.

Original entry on oeis.org

1, 4, 16, 20, 22, 25, 31, 48, 51, 55, 64, 66, 82, 84, 90, 100, 102, 120, 126, 127, 152, 156, 177, 197, 201, 203, 206, 212, 222, 231, 237, 238, 246, 252, 264, 266, 267, 272, 295, 297, 324, 337, 339, 347, 362, 364, 375, 379, 389, 396, 399, 401, 403, 415, 424, 433, 439, 449, 457, 460, 464, 466, 473, 489, 508, 509, 517, 518, 536, 540, 558, 575, 576, 578
Offset: 1

Views

Author

Antti Karttunen, Nov 13 2016

Keywords

Crossrefs

Cf. A277888 (primes themselves).

A278166 a(n) = number of integers one more than a prime encountered before reaching 0 when starting from k = ((n+1)^2)-1 and iterating map k -> k - A002828(k).

Original entry on oeis.org

1, 3, 3, 5, 7, 9, 9, 11, 12, 14, 15, 18, 19, 22, 23, 26, 29, 31, 34, 37, 42, 46, 47, 51, 54, 58, 60, 64, 68, 70, 74, 78, 82, 85, 88, 92, 95, 99, 104, 109, 114, 118, 122, 128, 134, 137, 140, 149, 153, 158, 164, 173, 177, 183, 187, 191, 199, 205, 210, 217, 222, 231, 236, 241, 248, 256, 262, 273, 278, 287, 291, 298, 307, 316, 322, 332
Offset: 1

Views

Author

Antti Karttunen, Nov 13 2016

Keywords

Examples

			For n=4, starting from k = ((4+1)^2)-1, and iterating k -> A255131(k), yields 24 -> 21 -> 18 -> 16 -> 15 -> 11 -> 8 -> 6 -> 3 before 0 is reached. Subtracting one from each gives [23, 20, 17, 15, 14, 10, 7, 5, 2], of which only 23, 17, 7, 5 and 2 are primes, thus a(4) = 5.
		

Crossrefs

Partial sums of A277486.

Programs

Formula

a(1) = A277486(1); for n > 1, a(n) = A277486(n) + a(n-1).

A278168 a(n) = number of integers one less than a prime encountered before reaching 0 when starting from k = ((n+1)^2)-1 and iterating map k -> k - A002828(k).

Original entry on oeis.org

0, 1, 1, 3, 4, 5, 5, 8, 10, 13, 15, 16, 17, 19, 20, 23, 25, 28, 29, 31, 35, 39, 40, 42, 45, 47, 49, 52, 56, 59, 62, 66, 69, 73, 76, 78, 82, 87, 92, 96, 100, 103, 107, 112, 116, 120, 123, 127, 133, 137, 143, 151, 155, 159, 162, 167, 174, 177, 184, 186, 192, 198, 202, 209, 216, 220, 225, 232, 236, 244, 250, 254, 258, 261, 267, 278, 282, 287, 292, 301
Offset: 1

Views

Author

Antti Karttunen, Nov 13 2016

Keywords

Examples

			For n=4, starting from k = ((4+1)^2)-1, and iterating k -> A255131(k), yields 24 -> 21 -> 18 -> 16 -> 15 -> 11 -> 8 -> 6 -> 3 before 0 is reached. Subtracting one from each gives [25, 22, 19, 17, 16, 12, 9, 7, 4], of which only 19, 17, and 7 are primes, thus a(4) = 3.
		

Crossrefs

Partial sums of A277488.

Programs

Formula

a(1) = A277488(1); for n > 1, a(n) = A277488(n) + a(n-1).
Showing 1-5 of 5 results.