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.

A073736 Sum of primes whose index is congruent to n (mod 3); equals the partial sums of A073737 (in which sums of three successive terms form the primes).

Original entry on oeis.org

1, 2, 3, 6, 9, 14, 19, 26, 33, 42, 55, 64, 79, 96, 107, 126, 149, 166, 187, 216, 237, 260, 295, 320, 349, 392, 421, 452, 499, 530, 565, 626, 661, 702, 765, 810, 853, 922, 973, 1020, 1095, 1152, 1201, 1286, 1345, 1398, 1485, 1556, 1621, 1712, 1785, 1854, 1951
Offset: 0

Views

Author

Paul D. Hanna, Aug 07 2002

Keywords

Comments

For purposes of this sequence, 1 is treated as a prime. - Harvey P. Dale, Jul 24 2013

Examples

			a(10) = p_10 + p_7 + p_4 + p_1 = 29 + 17 + 7 + 2 = 55.
		

Crossrefs

Cf. A073737.

Programs

  • Haskell
    a073736 n = a073736_list !! n
    a073736_list = scanl1 (+) a073737_list
    -- Reinhard Zumkeller, Apr 28 2013
  • Mathematica
    a[0] = 1; a[-1] = 0; a[-2] = 0; p[0] = 1; p[n_?Positive] := Prime[n]; a[n_] := a[n] = p[n] - a[n-1] - a[n-2]; Table[a[n], {n, 0, 60}] // Accumulate (* Jean-François Alcover, Jun 25 2013 *)
    Sort[Flatten[Accumulate/@Transpose[Partition[Join[{1},Prime[Range[61]]], 3]]]] (* Harvey P. Dale, Jul 24 2013 *)

Formula

a(n) = Sum_{m<=n, m=n (mod 3)} p_m, where p_m is the m-th prime; that is, a(3n+k) = p_(3n) + p_(3(n-1)) + p_(3(n-2)) + ... + p_k, for 0<=k<3, where a(0)=1 and the 0th prime is taken to be 1.

A083242 For n >= 3, a(n-3) + a(n-2) + a(n-1) + a(n) = prime(n); a(0) = 0, a(1) = 1, a(2) = 1.

Original entry on oeis.org

0, 1, 1, 3, 2, 5, 3, 7, 4, 9, 9, 9, 10, 13, 11, 13, 16, 19, 13, 19, 20, 21, 19, 23, 26, 29, 23, 25, 30, 31, 27, 39, 34, 37, 29, 49, 36, 43, 35, 53, 42, 49, 37, 63, 44, 53, 39, 75, 56, 57, 41, 79, 62, 59, 51, 85, 68, 65, 53, 91, 72, 67, 63, 105, 76, 69, 67, 119
Offset: 0

Views

Author

Labos Elemer, Apr 24 2003

Keywords

Examples

			a(43) + a(44) + a(45) + a(46) = 63 + 44 + 53 + 39 = 199 = p[46]
		

Crossrefs

Programs

  • Maple
    f:= proc(n) option remember; ithprime(n) - procname(n-1) - procname(n-2)-procname(n-3) end proc:
    f(0):= 0: f(1):= 1: f(2):= 1:
    map(f, [$0..100]); # Robert Israel, Aug 20 2024
  • Mathematica
    f[x_] := Prime[x]-f[x-1]-f[x-2]-f[x-3] {f[0]=0, f[1]=1, f[2]=1}; Table[f[w], {w, 0, 20}]

Formula

From Robert Israel, Aug 20 2024: (Start)
a(4*k) = Sum_{j=1..k} A001223(4*j-1).
a(4*k + 1) = 1 + Sum_{j=1..k} A001223(4*j).
a(4*k + 2) = Sum_{j=0..k} A001223(4*j+1).
a(4*k + 3) = 1 + Sum_{j=0..k} A001223(4*j+2). (End)

A103781 Sum of any four successive terms is prime, a(1)=a(2)=0,a(3)=1.

Original entry on oeis.org

0, 0, 1, 1, 1, 2, 3, 5, 3, 6, 5, 9, 9, 8, 11, 13, 11, 12, 17, 19, 13, 18, 21, 21, 19, 22, 27, 29, 23, 24, 31, 31, 27, 38, 35, 37, 29, 48, 37, 43, 35, 52, 43, 49, 37, 62, 45, 53, 39, 74, 57, 57, 41, 78, 63, 59, 51, 84, 69, 65, 53, 90, 73, 67, 63, 104, 77, 69, 67, 118, 83, 79, 69
Offset: 1

Views

Author

Zak Seidov, Feb 15 2005

Keywords

Crossrefs

Programs

  • Mathematica
    (*seed*)b4 = {0, 0, 1}; Do[x = Prime[n] - (b4[[ -1]] + b4[[ -2]] + b4[[ -3]]); b4 = Append[b4, x], {n, 1, 200}]; b4
    nxt[{a_, b_, c_}] := {b, c, NextPrime[a + b + c] - (a+b + c)}; NestList[nxt, {0, 0, 1}, 100][[All, 1]] (* Harvey P. Dale, Sep 20 2022 *)

Formula

a(n) = A000040(n-3) - a(n-1) - a(n-2) - a(n-3). - Jason Yuen, Sep 01 2024
Showing 1-3 of 3 results.