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

A276573 The infinite trunk of least squares beanstalk: The only infinite sequence such that a(0) = 0 and a(n-1) = a(n) - least number of squares (A002828) that sum to a(n).

Original entry on oeis.org

0, 3, 6, 8, 11, 15, 16, 18, 21, 24, 27, 30, 32, 35, 38, 40, 43, 45, 48, 51, 53, 56, 59, 63, 64, 67, 70, 72, 75, 78, 80, 83, 85, 88, 90, 93, 96, 99, 102, 105, 108, 112, 115, 117, 120, 123, 126, 128, 131, 134, 136, 139, 143, 144, 147, 149, 152, 155, 158, 160, 162, 165, 168, 171, 173, 176, 179, 183, 186, 189, 192, 195
Offset: 0

Views

Author

Antti Karttunen, Sep 07 2016

Keywords

Crossrefs

Cf. A002828, A005563, A255131, A260731, A260733, A262689, A276572, A276574, A276575 (first differences), A277016 (squares present), A277015 (their square roots), A277888 (primes), A278486 (numbers one more than a prime), A278265, A278487, A278488, A278491 (another subsequence), A278497, A278498, A278499, A278513, A278516, A278517, A278518, A278519, A278521, A278522.
Cf. A277890 & A277891 (number of even and odd terms in each range. The latter seem to be slightly more numerous), A277889.
Positions of nonzero terms in A278515.
Subsequence of A278489, no common terms with A278490.
Cf. also A179016, A259934, A276583, A276613, A276623 for similar constructions.

Programs

Formula

a(n) = A276574(A276572(n)).
Other identities and observations. For all n >= 0:
A260731(a(n)) = n.
a(A260733(n+1)) = A005563(n).
A278517(n) <= a(n) <= A278519(n).
A010873(a(n)) = A278499(n). [Terms reduced modulo 4.]
A010877(a(n)) = A278488(n). [modulo 8.]
A046523(a(n)) = A278497(n). [Least number with the same prime signature.]
A008683(a(n)) = A278513(n).
A065338(a(n)) = A278498(n).
A278509(a(n)) = A278265(n).
A278216(a(n)) = A278516(n). [Number of children the n-th node of the trunk has.]

Extensions

Definition clarified and more identities added to the Formula section by Antti Karttunen, Nov 28 2016

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

A277890 Number of even numbers encountered before (n^2)-1 is reached when starting from k = ((n+1)^2)-1 and iterating map k -> k - A002828(k).

Original entry on oeis.org

0, 2, 0, 3, 2, 3, 1, 5, 3, 4, 4, 6, 3, 5, 3, 7, 8, 8, 6, 8, 9, 10, 6, 8, 10, 10, 7, 11, 10, 13, 11, 12, 12, 14, 10, 13, 12, 13, 14, 15, 13, 15, 15, 18, 18, 16, 15, 17, 21, 18, 18, 18, 19, 20, 16, 21, 20, 20, 22, 20, 23, 20, 22, 23, 21, 23, 23, 27, 25, 24, 22, 28, 22, 27, 24, 26, 25, 25, 29, 29, 28, 26, 30, 31, 28, 28, 31, 30, 32, 33, 27, 32, 34, 34, 30, 33, 33
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 even, but the ending point (n^2)-1 is never included in the count.
a(n) = number of even numbers on row n of A276574, after the initial zero-row.
See also comments in A277891.

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 three of these numbers are even, thus a(6) = 3.
		

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

Formula

a(n) + A277891(n) = A260734(n).
For n >= 2, a(n) >= A277486(n).
a(n) >= A277488(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).

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

A276572 Simple self-inverse permutation of natural numbers: after a(0)=0, list each block of A260734(n) numbers in reverse order, from A260732(n) to A260733(1+n).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Sep 07 2016

Keywords

Comments

Maps between A276573 and A276574.

Crossrefs

Programs

  • Mathematica
    f[n_] := NestWhileList[# - (If[First@ # > 0, 1, Length[First@ Split@ #] + 1] &@ SquaresR[Range@ 4, #]) &, n^2, # != 0 &]; t = Table[Table[n, {Length[#] - 1 &@ NestWhileList[# - (If[First@ # > 0, 1, Length[First@ Split@ #] + 1] &@ SquaresR[Range@ 4, #]) &, ((n + 1)^2) - 1, # != (n^2) - 1 &]}], {n, 20}] // Flatten ; {0}~Join~Table[Length@ f@ t[[n]] - 1 + Length@ f[t[[n]] + 1] - n - 2, {n, 81}] (* Michael De Vlieger, Sep 08 2016 *)
  • Scheme
    (define (A276572 n) (if (zero? n) n (+ (- (A260733 (+ 1 (A276571 n))) n) (A260732 (A276571 n)))))

Formula

a(0) = 0; for n >= 1, a(n) = (A260733(1+A276571(n))-n)+A260732(A276571(n)).
Showing 1-6 of 6 results.