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.

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

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).
Showing 1-3 of 3 results.