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

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)).

A277486 a(n) = number of integers one more than a prime 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, 2, 0, 2, 2, 2, 0, 2, 1, 2, 1, 3, 1, 3, 1, 3, 3, 2, 3, 3, 5, 4, 1, 4, 3, 4, 2, 4, 4, 2, 4, 4, 4, 3, 3, 4, 3, 4, 5, 5, 5, 4, 4, 6, 6, 3, 3, 9, 4, 5, 6, 9, 4, 6, 4, 4, 8, 6, 5, 7, 5, 9, 5, 5, 7, 8, 6, 11, 5, 9, 4, 7, 9, 9, 6, 10, 5, 5, 17, 4, 10, 9, 10, 7, 3, 3, 10, 8, 7, 10, 6, 9, 5, 10, 10, 10, 8, 11, 6, 9, 10, 7, 7, 7, 7, 12, 9, 11, 13, 9, 12, 6, 10, 9, 6
Offset: 1

Views

Author

Antti Karttunen, Nov 08 2016

Keywords

Examples

			For n=6, we start iterating from k = ((6+1)^2)-1 = 48, and then 48 - A002828(48) = 45, 45 - A002828(45) = 43, 43 - A002828(43) = 40, 40 - A002828(40) = 38, and 38 - A002828(38) = 35 (which is 6^2 - 1), and when we subtract one from each, only 47 and 37 are primes, thus a(6) = 2.
For n=7, we start iterating from k = ((7+1)^2)-1 = 63, and 63 -> 59, 59 -> 56, 56 -> 53, 53 -> 51, 51 -> 48 (which is 7^2 - 1), and subtracting one from each of 63, 59, 56, 53 and 51, doesn't yield a prime for any, thus a(7)=0. (Note that even though 48-1 = 47 is a prime, it is not included in the count for n=7).
		

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
    A277486(n) = { my(orgk = ((n+1)^2)-1); my(k = orgk, s = 0); while(((k == orgk) || !issquare(1+k)), s = s + if(isprime(k-1),1,0); k = k - A002828(k)); s; };
    for(n=1, 10000, write("b277486.txt", n, " ", A277486(n)));
    
  • Scheme
    (define (A277486 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 (+ -1 k))))))))

Formula

For n >= 2, a(n) <= A277890(n).

A277488 a(n) = number of integers one less than a prime 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

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

Views

Author

Antti Karttunen, Nov 08 2016

Keywords

Comments

Only 325 cases in range n=1..10000 where a(n) >= A277486(n). See also comments in A277487.

Examples

			For n=6, we start iterating from k = ((6+1)^2)-1 = 48, and then 48 - A002828(48) = 45, 45 - A002828(45) = 43, 43 - A002828(43) = 40, 40 - A002828(40) = 38, and 38 - A002828(38) = 35 (which is 6^2 - 1), and when we add one to each, only 41 is prime, thus a(6) = 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
    A277488(n) = { my(orgk = ((n+1)^2)-1); my(k = orgk, s = 0); while(((k == orgk) || !issquare(1+k)), s = s + if(isprime(1+k),1,0); k = k - A002828(k)); s; };
    for(n=1, 10000, write("b277488.txt", n, " ", A277488(n)));
    
  • Scheme
    (define (A277488 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 (+ 1 k))))))))

Formula

For all n >= 1, a(n) <= A277890(n).

A278167 a(n) = number of primes 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, 1, 2, 2, 2, 3, 5, 6, 7, 7, 9, 10, 12, 12, 15, 17, 17, 20, 20, 22, 22, 23, 27, 29, 32, 34, 38, 40, 40, 43, 46, 48, 53, 56, 60, 63, 66, 69, 71, 75, 77, 79, 83, 86, 89, 92, 98, 101, 102, 105, 109, 111, 117, 120, 123, 125, 130, 135, 140, 145, 149, 152, 159, 163, 167, 173, 177, 179, 183, 189, 194, 199, 204, 208, 215, 219, 223, 230, 234
Offset: 1

Views

Author

Antti Karttunen, Nov 13 2016

Keywords

Comments

a(n) = number of terms of A277888 less than (n+1)^2.

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. Of these numbers only 11 and 3 are primes, thus a(4) = 2.
		

Crossrefs

Partial sums of A277487.

Programs

Formula

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

A278487 Primes p such that p+1 is in A276573, the infinite trunk of least squares beanstalk.

Original entry on oeis.org

2, 5, 7, 17, 23, 29, 31, 37, 47, 71, 79, 89, 101, 107, 127, 151, 157, 167, 191, 197, 199, 223, 239, 263, 269, 271, 293, 311, 317, 337, 359, 367, 383, 389, 421, 433, 439, 443, 449, 461, 463, 479, 487, 503, 509, 521, 541, 593, 599, 607, 619, 631, 647, 653, 677, 709, 719, 727, 751, 773, 797, 809, 823, 839, 857, 863, 881, 887, 911, 919
Offset: 1

Views

Author

Antti Karttunen, Nov 25 2016

Keywords

Comments

These seem to be substantially more common than A277888, even though odd terms are slightly more common in A276573 than the even terms. See also comments in A277487.

Crossrefs

One less than A278486.
No common terms with A277888, some common terms with A278494.
Cf. A277486 (gives the count of these primes in each range [n^2, (n+1)^2]).

Programs

Formula

a(n) = A278486(n) - 1 = A276573(A278485(n)) - 1.

A277891 a(n) = number of odd numbers 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, 2, 1, 2, 2, 4, 2, 4, 3, 4, 4, 6, 5, 7, 6, 5, 6, 7, 7, 6, 6, 11, 9, 9, 9, 12, 9, 10, 9, 11, 11, 12, 11, 14, 13, 15, 12, 14, 14, 16, 14, 15, 13, 15, 17, 18, 17, 14, 17, 19, 18, 20, 17, 22, 19, 22, 20, 20, 22, 20, 22, 23, 22, 24, 25, 22, 22, 25, 26, 26, 25, 28, 24, 30, 26, 28, 29, 27, 27, 28, 32, 29, 28, 32, 32, 29, 31, 30, 29, 35, 33, 32, 32, 35, 34, 35, 36
Offset: 1

Views

Author

Antti Karttunen, Nov 08 2016

Keywords

Comments

The starting point ((n+1)^2)-1 of the iteration is included if it is odd, but the ending point (n^2)-1 is never included in the count.
a(n) = number of odd numbers on row n of A276574, after the initial zero-row.
On the average, the odd terms in A276573 (A276574) seem to occur more frequently than the even terms. (The last point in range 1..10000 where a(n) <= A277890(n) is n=862). See also comments in A277487 and the plot of ratio a(n)/A277890(n), also the plot of A277889.

Examples

			For n=6, we start iterating from k = ((6+1)^2)-1 = 48, with k -> k - A002828(k), to obtain 48 -> 45 -> 43 -> 40 -> 38 before reaching 35 (which is 6^2 - 1, an ending point and thus not included in the count), and the only odd numbers before that were 45 and 43, thus a(6) = 2.
		

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
    A277891(n) = { my(orgk = ((n+1)^2)-1); my(k = orgk, s = 0); while(((k == orgk) || !issquare(1+k)), s = s + (k%2); k = k - A002828(k)); s; };
    for(n=1, 10000, write("b277891.txt", n, " ", A277891(n)));
    
  • Scheme
    (define (A277891 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 (A000035 k)))))))

Formula

a(n) + A277890(n) = A260734(n).
a(n) >= A277487(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).

A278495 a(n) = number of primes in range [n^2, (n+1)^2] that are leaves in "the least squares beanstalk" tree.

Original entry on oeis.org

1, 2, 1, 2, 2, 2, 1, 1, 2, 4, 1, 2, 1, 3, 2, 4, 3, 3, 3, 5, 3, 2, 2, 4, 4, 4, 4, 3, 4, 4, 4, 4, 2, 3, 3, 2, 4, 2, 5, 4, 6, 3, 5, 4, 5, 5, 4, 6, 3, 3, 6, 8, 4, 5, 3, 5, 5, 5, 4, 6, 6, 7, 5, 5, 7, 6, 8, 8, 8, 8, 5, 5, 5, 8, 7, 7, 7, 3, 13, 5, 8, 6, 8, 7, 8, 5, 14, 7, 8, 8, 10, 7, 5, 8, 6, 7, 6, 9, 4, 10, 4, 9, 8, 6, 8, 8, 8, 6, 10, 11, 13, 9
Offset: 1

Views

Author

Antti Karttunen, Nov 25 2016

Keywords

Comments

Number of terms of A278494 in range [n^2, (n+1)^2], where A278494 are primes p for which there does not exist any such integer k that k - A002828(k) = p.
In other words, number of primes p in range [n^2, (n+1)^2] for which (A002828(1+p) <> 1) and (A002828(2+p) <> 2) and (A002828(3+p) <> 3) and (A002828(4+p) <> 4).
Conjecture: a(n) > 0 for all n >= 1.
Similar guesses are easy to make but hard to prove. I also conjecture that A277487(n) > 0 for all n > 80, and that both A277486(n) > 0 and A277488(n) > 0 for all n > 7. If any of these claims were proved true, it would imply the proof of Legendre's conjecture as well. See also comments in A014085 and sequences A277888 & A278487.

Crossrefs

Cf. A000290, A002828, A010051, A010052, A014085 (an upper bound), A278216, A278494 (primes that are counted), A278496.
Cf. also A277486, A277487, A277488.

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
    A278495(n) = { my(s = 0); for(k=(n^2),(n+1)^2, if((isprime(k) && (A002828(1+k) <> 1) && (A002828(2+k) <> 2) && (A002828(3+k) <> 3) && (A002828(4+k) <> 4)),s = s+1) ); s; };
    for(n=1, 10000, write("b278495.txt", n, " ", A278495(n)));
    
  • Scheme
    (define (A278495 n) (let loop ((k (+ -1 (A000290 (+ 1 n)))) (s 0)) (if (= 1 (A010052 k)) s (loop (- k 1) (+ s (* (A010051 k) (if (zero? (A278216 k)) 1 0)))))))

Formula

For all n >= 1, a(n) <= A014085(n).
Showing 1-8 of 8 results.