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.

A385987 Prime numbers of the form A385986(1) + ... + A385986(k) for some k > 0.

Original entry on oeis.org

2, 3, 5, 11, 31, 67, 197, 887, 1523, 1783, 2473, 2789, 3121, 3469, 3833, 4783, 4993, 5849, 6079, 6547, 7757, 8543, 9091, 10501, 12011, 16519, 18787, 19993, 20407, 21661, 22091, 23827, 27427, 29837, 30841, 32371, 33937, 34471, 37699, 38261, 42223, 43411, 50033
Offset: 1

Views

Author

Rémy Sigrist, Jul 14 2025

Keywords

Examples

			A385986(1) + ... + A385986(5) = 2 + 1 + 2 + 3 + 3 = 11 is prime, so 11 appears in this sequence.
		

Crossrefs

Cf. A385986.

Programs

  • PARI
    { v = 2; t = 0; for (n = 1, 323, if (isprime(t += v), print1 (t", "); v = n;);); }

A386369 a(1) = 0, and for any n > 1, a(n) is the largest k < n such that a(1) + ... + a(k) is a square number.

Original entry on oeis.org

0, 1, 2, 2, 2, 2, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 18, 18, 18, 18, 18, 18, 18, 18, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26
Offset: 1

Views

Author

Rémy Sigrist, Jul 19 2025

Keywords

Comments

In other words: a(1) = 0, and for any n > 0, if a(1) + ... + a(n) is a square number then a(n+1) = n, otherwise a(n+1) = a(n).
This sequence is unbounded: if a(1) + ... + a(n) = u^2, then a(n+1) = n, u^2 + n * (2*u+n) = (u+n)^2, so a(1) + ... + a(m) is a square number for some m > n, and a(m+1) = m > a(n+1).

Examples

			Sequence begins:
  n   a(n)  a(1)+...+a(n)  Square?
  --  ----  -------------  -------
   1     0              0  Yes
   2     1              1  Yes
   3     2              3  No
   4     2              5  No
   5     2              7  No
   6     2              9  Yes
   7     6             15  No
   8     6             21  No
   9     6             27  No
  10     6             33  No
		

Crossrefs

See A385986 for a similar sequence.

Programs

  • Mathematica
    Module[{s = 0,a = 0}, Table[If[IntegerQ[Sqrt[s += a]], a = n-1]; a, {n, 100}]] (* Paolo Xausa, Jul 29 2025, after Rémy Sigrist *)
  • PARI
    { t = 0; v = 0; for (n = 1, 70, print1 (v", "); t += v; if (issquare(t), v = n;);); }

A385988 a(1) = 1, and for any n > 1, a(n) is the largest k < n such that a(1) + ... + a(k) is a power of 2.

Original entry on oeis.org

1, 1, 2, 3, 3, 3, 3, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23
Offset: 1

Views

Author

Rémy Sigrist, Jul 14 2025

Keywords

Comments

In other words: a(1) = 1, and for any n > 0, if a(1) + ... + a(n) is a power of 2 then a(n+1) = n, otherwise a(n+1) = a(n).
This sequence is unbounded: if a(1) + ... + a(n) = 2^i, let n = m * 2^j with m odd, note that n <= 2^i, so j <= i, let z be the multiplicative order of m modulo 2, let t = 2^(i-j) * (2^z - 1) / m, a(1) + ... + a(n) + t * n = 2^(z+i), so a(1) + ... + a(n) + u * n is a power of 2 for some u in the range n+1..t, and a(u+1) > a(n+1) = n.

Examples

			Sequence begins:
  n   a(n)  a(1)+...+a(n)  Power of 2?
  --  ----  -------------  -----------
   1     1              1  Yes
   2     1              2  Yes
   3     2              4  Yes
   4     3              7  No
   5     3             10  No
   6     3             13  No
   7     3             16  Yes
   8     7             23  No
   9     7             30  No
  10     7             37  No
  11     7             44  No
  12     7             51  No
		

Crossrefs

See A385986 for a similar sequence.
Cf. A386905 (distinct terms).

Programs

  • Mathematica
    Module[{s = -1, a = 1}, Table[If[DigitSum[s += a, 2] == 1, a = n - 1]; a, {n, 100}]] (* Paolo Xausa, Aug 07 2025 *)
  • PARI
    { v = 1; t = 0; for (n = 1, 71, print1(v", "); if (hammingweight(t += v)==1, v = n;);); }
Showing 1-3 of 3 results.