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.

Previous Showing 11-20 of 90 results. Next

A180466 The number of representations of n as a minimal number of squares, A002828(n).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 2, 1, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 3, 3, 1, 2, 1, 2, 3, 1, 2, 4, 1, 2, 3, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 3, 1, 1, 1, 2, 1, 2, 3, 4, 1, 1, 1, 1, 3, 1, 2, 3, 1, 1, 1, 3, 1
Offset: 1

Views

Author

T. D. Noe, Jan 19 2011

Keywords

Comments

By Lagrange's four square theorem, the minimal number of squares required to represent a number is 4 or less. See A141490 for the numbers k that have n minimal representations.

Examples

			27 has the following representations as the sum of 4 or fewer squares: 1+1+25, 9+9+9, and 1+1+9+16. The minimal number of squares is 3 and there are 2 such representations.  Hence a(27)=2.
		

Programs

  • Mathematica
    Table[r=PowersRepresentations[n,4,2]; Sort[Tally[4-Count[#,0]& /@ r]][[1,2]], {n,100}]

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

A159629 Slowest increasing sequence beginning with a(1)=4 such that A002828(a(n)) = A002828(n).

Original entry on oeis.org

4, 5, 6, 9, 10, 11, 15, 17, 25, 26, 27, 30, 32, 33, 39, 49, 50, 52, 54, 58, 59, 62, 63, 66, 81, 82, 83, 87, 89, 91, 92, 97, 99, 101, 102, 121, 122, 123, 124, 125, 128, 129, 131, 132, 136, 138, 143, 147, 169, 170, 171, 173, 178, 179, 183, 184, 186, 193, 195, 199, 200, 201, 207
Offset: 1

Views

Author

Vladimir Shevelev, Apr 17 2009, May 04 2009

Keywords

Comments

Conjecture: For every m>2 there exists a minimum index N(m) such that the minimal increasing recursive sequence S_m(n) beginning with m^2 with the condition A002828(S_m(n)) = A002828(n) coincides with a(n) for all n>N.

Crossrefs

Programs

  • Mathematica
    a2828[n_] := Which[SquaresR[1, n]>0, 1, SquaresR[2, n]>0, 2, SquaresR[3, n] > 0, 3, True, 4];
    a[1] = 4; a[n_] := a[n] = For[k = a[n-1]+1, True, k++, If[a2828[k] == a2828[n], Return[k]]];
    Array[a, 63] (* Jean-François Alcover, Jul 28 2018 *)

Formula

a(n+1) = min { l > a(n) : A002828(l) = A002828(n+1) }.

Extensions

137 replaced by 136, extended by R. J. Mathar, Sep 17 2009

A277192 Number of integers k in range [n^2, ((n+1)^2)-1] for which the least number of squares that add up to k (A002828) is even.

Original entry on oeis.org

1, 1, 3, 3, 4, 6, 6, 8, 8, 9, 11, 10, 13, 12, 13, 16, 15, 16, 17, 19, 17, 22, 20, 21, 23, 24, 23, 25, 26, 26, 28, 30, 28, 30, 31, 31, 31, 34, 34, 35, 35, 37, 37, 40, 38, 41, 42, 40, 44, 43, 44, 45, 44, 46, 45, 50, 50, 49, 48, 54, 53, 52, 52, 57, 55, 56, 57, 58, 58, 60, 60, 58, 65, 61, 64, 66, 64, 65, 66, 68, 69, 68, 70, 69
Offset: 0

Views

Author

Antti Karttunen, Oct 04 2016

Keywords

Crossrefs

Programs

  • Scheme
    (define (A277192 n) (add (lambda (i) (- 1 (A000035 (A002828 i)))) (A000290 n) (+ -1 (A000290 (+ 1 n)))))
    ;; Implements sum_{i=lowlim..uplim} intfun(i)
    (define (add intfun lowlim uplim) (let sumloop ((i lowlim) (res 0)) (cond ((> i uplim) res) (else (sumloop (1+ i) (+ res (intfun i)))))))

Formula

a(n) = Sum_{i=n^2 .. ((n+1)^2)-1} (1-A000035(A002828(i))).
For all n >= 0, A277191(n) + a(n) = 2n+1.
For n >= 1, a(n) = A077773(n) + A277194(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).

A278491 After a(0)=0, numbers n such that (A002828(1+n) = 1) and (A002828(4+n) = 4).

Original entry on oeis.org

0, 3, 24, 35, 99, 120, 195, 323, 440, 483, 675, 728, 899, 1155, 1368, 1443, 1763, 1848, 2115, 2499, 2808, 2915, 3363, 3480, 3843, 4355, 4760, 4899, 5475, 5624, 6083, 6723, 7224, 7395, 8099, 8280, 8835, 9603, 10200, 10403, 11235, 11448, 12099, 12995, 13688, 13923, 14883, 15128, 15875, 16899, 17688, 17955, 19043, 19320, 20163
Offset: 0

Views

Author

Antti Karttunen, Nov 26 2016

Keywords

Comments

The definition implies that after 0 these are also all numbers n such that (A002828(1+n) = 1), (A002828(2+n) = 2), (A002828(3+n) = 3) and (A002828(4+n) = 4).
Because A002828 obtains value 1 only at squares, every term must be one less than a square.
In the terms of tree defined by edge relation A255131(child) = parent, ("the least squares beanstalk"), these numbers are the nodes with four children (maximum possible).
Either of the above facts implies that this is a subsequence of A276573.
Indexing starts from zero, because a(0)=0 is a special case in this sequence, as it is only number which is its own child in the least squares beanstalk tree.

Crossrefs

Subsequence of A005563, A276573 and A278489.

Programs

  • PARI
    \\ (For a more intelligent way to generate the terms, check Altug Alkan's PARI-code for A273324).
    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
    isA278491(n) = (!n || ((A002828(1+n) == 1) && (A002828(4+n) == 4)));
    i=0; n=0; while(i <= 10000, if(isA278491(n), write("b278491.txt", i, " ", n); i++); n++ );
    
  • Scheme
    ;; With Antti Karttunen's IntSeq-library.
    (define A278491 (MATCHING-POS 0 0 (lambda (n) (= 4 (A278216 n)))))

Formula

a(0) = 0, and for n >= 1, a(n) = A273324(n)^2 - 1.

A278494 Primes p for which there does not exist any such integer k that k - A002828(k) = p.

Original entry on oeis.org

2, 5, 7, 13, 17, 23, 29, 31, 37, 47, 61, 79, 89, 97, 101, 103, 109, 113, 127, 157, 167, 193, 197, 199, 223, 229, 241, 257, 269, 271, 281, 293, 313, 317, 337, 353, 359, 383, 389, 397, 401, 409, 421, 433, 439, 449, 461, 463, 487, 509, 541, 569, 577, 593, 601, 607, 631, 647, 653, 673, 677, 709, 719, 727, 751, 761, 769, 773, 797
Offset: 1

Views

Author

Antti Karttunen, Nov 25 2016, with additional comments Nov 28 2016

Keywords

Comments

Primes that are leaves in the tree defined by edge relation parent = A255131(child), "the least squares beanstalk".
Primes p such that (A002828(1+p) <> 1), (A002828(2+p) <> 2), (A002828(3+p) <> 3) and (A002828(4+p) <> 4).
See comments in A278495 which gives the count of these primes in each range [n^2, (n+1)^2].
This is a subsequence of A045352 as no prime of the form 8n+3 ever occurs in this sequence. This stems from a more general fact that A278490 contains no numbers of the form 8n+3, because A002828(8n+7) = 4 for all n. (See A004215.)

Crossrefs

Intersection of A000040 and A278490.
No common terms with A277888, some common terms with A278487.
Subsequence of A045352.
Cf. also A263091.

A262690 a(n) = largest square k <= n such that A002828(n-k) = A002828(n)-1.

Original entry on oeis.org

0, 1, 1, 1, 4, 4, 4, 4, 4, 9, 9, 9, 4, 9, 9, 9, 16, 16, 9, 9, 16, 16, 9, 9, 16, 25, 25, 25, 25, 25, 25, 25, 16, 25, 25, 25, 36, 36, 36, 36, 36, 25, 25, 25, 36, 36, 36, 36, 16, 49, 49, 49, 36, 49, 49, 49, 36, 49, 49, 49, 49, 36, 49, 49, 64, 64, 64, 49, 64, 64, 36, 49, 36, 64, 49, 49, 36, 64, 49, 49, 64, 81, 81, 81, 64, 81, 81, 81, 36, 64, 81, 81, 81, 64, 81, 81, 64, 81, 49, 81, 100
Offset: 0

Views

Author

Antti Karttunen, Oct 03 2015

Keywords

Crossrefs

Programs

Formula

a(n) = A000290(A262689(n)).
Other identities. For all n >= 0:
A262678(n) = n - a(n).

A277191 Number of integers k in range [n^2, ((n+1)^2)-1] for which the least number of squares that add up to k (A002828) is odd.

Original entry on oeis.org

0, 2, 2, 4, 5, 5, 7, 7, 9, 10, 10, 13, 12, 15, 16, 15, 18, 19, 20, 20, 24, 21, 25, 26, 26, 27, 30, 30, 31, 33, 33, 33, 37, 37, 38, 40, 42, 41, 43, 44, 46, 46, 48, 47, 51, 50, 51, 55, 53, 56, 57, 58, 61, 61, 64, 61, 63, 66, 69, 65, 68, 71, 73, 70, 74, 75, 76, 77, 79, 79, 81, 85, 80, 86, 85, 85, 89, 90, 91, 91, 92, 95, 95, 98, 95, 100
Offset: 0

Views

Author

Antti Karttunen, Oct 04 2016

Keywords

Crossrefs

After the initial zero, one more than A277193.

Programs

  • Scheme
    (define (A277191 n) (add (lambda (i) (A000035 (A002828 i))) (A000290 n) (+ -1 (A000290 (+ 1 n)))))
    ;; Implements sum_{i=lowlim..uplim} intfun(i)
    (define (add intfun lowlim uplim) (let sumloop ((i lowlim) (res 0)) (cond ((> i uplim) res) (else (sumloop (1+ i) (+ res (intfun i)))))))

Formula

a(n) = Sum_{i=n^2 .. ((n+1)^2)-1} A000035(A002828(i)).
For all n >= 0, a(n) + A277192(n) = 2n+1.
For all n >= 1, a(n) = 1 + A277193(n).
Previous Showing 11-20 of 90 results. Next