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.

A373798 Divide A374965 into "blocks" by saying that each prime term ends a block; sequence gives lengths of successive blocks.

Original entry on oeis.org

2, 3, 4, 5, 5, 3, 3, 11, 2, 5, 4, 4, 5, 9, 7, 2, 2, 21, 3, 2, 3, 2, 3, 2, 3, 7, 3, 3, 2, 108, 17, 5, 12, 12, 2, 4, 3, 3, 4, 16, 9, 6, 231, 3, 2, 8, 3, 29, 3, 2, 5, 10, 5, 17, 2, 3, 212, 9, 3, 4, 5, 22, 3, 5, 13, 5, 9, 4, 12, 8, 2, 57, 2, 65, 5, 3, 93, 9, 46
Offset: 1

Views

Author

Harvey P. Dale and N. J. A. Sloane, Jul 28 2024

Keywords

Comments

The first 286 terms of the sequence are the result of dividing the first 10000 terms of A374965 into "blocks."
Comment from N. J. A. Sloane, Aug 09 2024 (Start):
Suppose p = A374965(t) is a prime in A374965, and is the s-th prime to appear there (that is, A375028(s) = p and A373799(s) = t). The next term in A374965 is by definition A374965(t+1) = prime(t+1) - 1 = r (say). Then the block starting with r has length a(s+1) = A050412(r) + 1. For example, p = 19 = A374965(5) is the second prime in A374695, so we have s = 2, t = 5, and r = prime(6) - 1 = 13 - 1 = 12. Then A050412(12) = 3, which tells us that a(3) = 3 + 1 = 4. The block is [12, 25, 51, 103].
For a larger example, the s = 285th prime in A374965 is p = 160077823 = A374965(7686), so t = 7686. The next block begins with r = prime(7687) - 1 = 78282. After 39 steps of double-and-add-1 (corresponding to A050412(78282) = 39) we reach the 286th prime in A374965, A374965(7726) = 43036534378594303. (End)

Examples

			A374965 begins
1, 3/ 4, 9, 19/ 12, 25, 51, 103/ 28, 57, 115, 231, 463/ 46, 93, 187, 375, 751/ 70, 141, 283/ 82, 165, ...,
where the primes are followed by slashes, to indicate the blocks. The lengths of the initial blocks are 2, 3, 4, 5, 5, 3, ...
		

Crossrefs

Programs

  • Mathematica
    nxt[{n_, a_}] := {n + 1, If[! PrimeQ[a], 2 a + 1, Prime[n + 1] - 1]}; vvv=NestList[nxt,{1,1},9999][[;;,2]]; Total/@Partition[Length/@SplitBy[vvv,PrimeQ],2] (* Harvey P. Dale, Jul 28 2024 *)