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 21 results. Next

A260740 a(n) = n minus the number of positive squares needed to sum to n using the greedy algorithm: a(n) = n - A053610(n).

Original entry on oeis.org

0, 0, 0, 0, 3, 3, 3, 3, 6, 8, 8, 8, 8, 11, 11, 11, 15, 15, 15, 15, 18, 18, 18, 18, 21, 24, 24, 24, 24, 27, 27, 27, 27, 30, 32, 32, 35, 35, 35, 35, 38, 38, 38, 38, 41, 43, 43, 43, 43, 48, 48, 48, 48, 51, 51, 51, 51, 54, 56, 56, 56, 56, 59, 59, 63, 63, 63, 63, 66, 66, 66, 66, 69, 71, 71, 71, 71, 74, 74, 74, 78, 80
Offset: 0

Views

Author

Antti Karttunen, Aug 12 2015

Keywords

Crossrefs

Formula

a(n) = n - A053610(n).
As a recurrence:
a(0) = 0; for n >= 1, a(n) = -1 + A048760(n) + a(n-A048760(n)). [Where A048760(n) gives the largest square <= n.]
Other identities. For all n >= 1:
a(n) = A255131(n) - A062535(n).

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

A276574 The infinite trunk of least squares beanstalk with reversed subsections.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Sep 07 2016

Keywords

Examples

			This can be viewed as an irregular table, where after 0, each row has A260734(n) = 1, 2, 2, 4, 4, 5, 5, 7, ... terms:
0;
3;
8, 6;
15, 11;
24, 21, 18, 16;
35, 32, 30, 27;
48, 45, 43, 40, 38;
63, 59, 56, 53, 51;
80, 78, 75, 72, 70, 67, 64;
99, 96, 93, 90, 88, 85, 83;
120, 117, 115, 112, 108, 105, 102;
...
Each row begins with (n^2)-1 (see A005563), and each successive term is obtained by subtracting A002828(k) from the previous term k, until ((n-1)^2)-1 would be encountered, which is not listed second time (as it already occurs as the first term of the previous row), but instead, the current row is finished and the next row is started with the term ((n+1)^2)-1.
		

Crossrefs

Cf. A005563 (left edge), A277023 (right edge).
Used to construct A276573.
Cf. A277015 (tells which rows end with squares, listed in A277016).

Programs

  • Scheme
    (definec (A276574 n) (cond ((zero? n) n) ((= 1 n) 3) (else (let ((maybe_next (A255131 (A276574 (- n 1))))) (if (zero? (A010052 (+ 1 maybe_next))) maybe_next (+ -1 (A000290 (+ 2 (A000196 (+ 1 maybe_next))))))))))

Formula

a(0) = 0; a(1) = 3; for n > 1, let k = A255131(a(n-1)). If k+1 is not a square, then a(n) = k, otherwise a(n) = A000290(2+A000196(k+1)) - 1.

Extensions

Example section added and the formula rewritten to a simpler form (which is now correct) - Antti Karttunen, Oct 16 2016

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

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.

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

A278496 a(n) = A000196(A278494(n)).

Original entry on oeis.org

1, 2, 2, 3, 4, 4, 5, 5, 6, 6, 7, 8, 9, 9, 10, 10, 10, 10, 11, 12, 12, 13, 14, 14, 14, 15, 15, 16, 16, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 19, 20, 20, 20, 20, 20, 21, 21, 21, 22, 22, 23, 23, 24, 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 31, 32, 32, 32, 32, 33, 33, 34, 34, 34
Offset: 1

Views

Author

Antti Karttunen, Nov 25 2016

Keywords

Comments

Each n occurs A278495(n) times.

Crossrefs

Programs

A284000 a(n) = a(a(n-A002828(n))) + a(n-a(n-A002828(n))) with a(1) = a(2) = a(3) = 1, where A002828(n) = the least number of squares that add up to n.

Original entry on oeis.org

1, 1, 1, 2, 3, 4, 5, 4, 5, 6, 7, 8, 9, 10, 9, 10, 9, 10, 11, 12, 13, 14, 15, 16, 15, 16, 17, 18, 17, 18, 19, 20, 19, 22, 21, 22, 23, 22, 23, 24, 25, 26, 27, 26, 27, 28, 29, 30, 29, 30, 31, 32, 33, 34, 35, 34, 37, 38, 37, 38, 39, 38, 39, 38, 39, 40, 39, 42, 41, 42
Offset: 1

Views

Author

Antti Karttunen, Mar 23 2017

Keywords

Comments

Does a(n)/n converge to some value near 0.6 ? See for example: a(10) = 6, a(100) = 62, a(1000) = 604, a(10000) = 6050, a(100000) = 60414.

Crossrefs

Formula

For n <= 3 a(n) = 1, else a(n) = a(a(A255131(n))) + a(n-a(A255131(n))).
Previous Showing 11-20 of 21 results. Next