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-6 of 6 results.

A085626 Partial sums of A051935.

Original entry on oeis.org

2, 5, 11, 19, 29, 41, 59, 79, 101, 127, 157, 191, 227, 269, 313, 359, 409, 461, 521, 587, 659, 733, 809, 887, 967, 1049, 1151, 1259, 1373, 1489, 1607, 1733, 1861, 1993, 2129, 2267, 2411, 2557, 2707, 2861, 3019, 3181, 3347, 3517, 3691, 3877, 4073, 4271, 4481
Offset: 1

Views

Author

Patrick Capelle, Jul 10 2003

Keywords

Comments

Same as A070865 after first term. - David Wasserman, Jun 27 2005

Examples

			a(3) = 11 because it is the sum of the first 3 terms of A051935: 2+3+6 = 11.
		

Crossrefs

A051956 a(n) = smallest number > a(n-1) such that a(1)*a(2)*...*a(n) + 1 and a(1)*a(2)*...*a(n) - 1 are primes.

Original entry on oeis.org

4, 15, 17, 19, 29, 57, 77, 285, 318, 354, 379, 405, 520, 521, 595, 625, 938, 1706, 1738, 2085, 2345, 2817, 4319, 4529, 7005, 8207, 8232, 9451, 9839, 11044, 11170, 12386, 12421, 12722, 14153, 15220, 15371, 17052, 17965, 18279, 18811, 19890, 21628, 22667, 22746
Offset: 1

Views

Author

Felice Russo, Dec 21 1999

Keywords

Crossrefs

Programs

  • Mathematica
    a[1] = 4; a[n_] := a[n] = For[k = a[n-1]+1, True, k++, p = Times @@ Array[a, n-1]; If[PrimeQ[k*p+1] && PrimeQ[k*p-1], Print[k]; Return[k]]]; Array[a, 45] (* Jean-François Alcover, Oct 23 2016 *)
  • PARI
    lista(nn) = {my (v = vector(nn)); for (n = 1, nn, if (n == 1, p = 1; k = 0; , p = prod(j=1, n-1, v[j]); k = v[n-1]+1); while (! isprime(p*k+1) || ! isprime(p*k-1), k++); v[n] = k; print1(k, ", "););} \\ Michel Marcus, Sep 28 2013

Extensions

More terms from Michel Marcus, Sep 28 2013

A078706 a(n) = smallest integer >=a(n-1) such that sum of first n terms is prime.

Original entry on oeis.org

2, 3, 6, 6, 6, 6, 8, 10, 12, 12, 12, 14, 16, 18, 18, 18, 24, 32, 34, 36, 38, 42, 46, 48, 54, 56, 64, 68, 78, 90, 90, 94, 102, 114, 122, 124, 134, 144, 148, 150, 152, 160, 168, 170, 178, 182, 190, 192, 200, 216, 220, 222, 234, 234, 234, 246, 260, 264, 268, 270, 278, 280
Offset: 1

Views

Author

Neil Fernandez, Dec 18 2002

Keywords

Examples

			a(1)=2, the first prime. The smallest integer >=2 that yields a prime when added to 2 is 3, so a(2)=3. The smallest integer >=3 that yields a prime when added to 2+3 is 6 so a(3)=6.
		

Crossrefs

Cf. A051935.

Programs

  • Mathematica
    s = 0; NestList[(s += #; NextPrime[s + # - 1] - s) &, 2, 61] (* Ivan Neretin, May 14 2015 *)
    nxt[{t_,a_}]:=Module[{k=a},While[CompositeQ[t+k],k++];{t+k,k}]; NestList[nxt,{2,2},70][[;;,2]] (* Harvey P. Dale, Sep 01 2024 *)

A219634 a(n) is the smallest number > a(n-1) such that 1 + a(1)^2 + a(2)^2 + ... + a(n)^2 is a prime.

Original entry on oeis.org

1, 3, 6, 12, 30, 54, 60, 72, 120, 126, 144, 174, 198, 210, 294, 300, 318, 354, 408, 420, 426, 432, 480, 498, 522, 564, 588, 594, 600, 624, 630, 648, 666, 714, 720, 852, 864, 978, 1002, 1050, 1056, 1080, 1098, 1122, 1146, 1152, 1170, 1176, 1200, 1206, 1458
Offset: 1

Views

Author

Michel Lagneau, Nov 24 2012

Keywords

Comments

The corresponding primes are 2, 11, 47, 191, 1091, 4007, 7607, 12791, 27191, 43067, ...

Examples

			a(1) = 1 because 1 + 1^2 = 2 is prime;
a(2) = 3 because 1 + 1^2 + 2^2 = 6 is not prime, but 1 + 1^2 + 3^2 = 11 is prime;
a(3) = 6 because neither 1 + 1^2 + 3^2 + 4^2 = 27 nor 1 + 1^2 + 3^2 + 5^2 = 36 is prime, but 1 + 1^2 + 3^2 + 6^2 = 47 is prime.
		

Crossrefs

Cf. A051935.

Programs

  • Mathematica
    p=1;lst={p};Do[If[PrimeQ[p+n^2],AppendTo[lst,n];p=p+n^2],{n,1,1500}];lst

A233334 a(1) = 1; for n > 1, a(n) is the smallest number > a(n-1) such that a(1) + a(2) + ... + a(n) is a composite number.

Original entry on oeis.org

1, 3, 4, 6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70
Offset: 1

Views

Author

Michel Lagneau, Dec 18 2013

Keywords

Comments

{a(n)} = {1, 3, 4, 6, 7} union {9, 10, 11, 12, ...} and the sum s(n) = a(1) + a(2) + ... + a(n) is always composite because s(1) = 1, s(2) = 4, s(3) = 8, s(4) = 14 and for n = 5,6,7,... s(n) = (n-2)*(n+9)/2 = 21, 30, 40, 51, ... = A056115(n) for n >= 3.

Examples

			The third term is 4 because 1+3+4=8 is composite.
		

Crossrefs

Programs

  • Mathematica
    p=1; lst={p}; Do[If[!PrimeQ[p+n], AppendTo[lst, n]; p=p+n], {n, 3, 70}]; lst
    nxt[{c_,a_}]:=Module[{k=a+1},While[!CompositeQ[c+k],k++];{c+k,k}]; NestList[nxt,{1,1},70][[;;,2]] (* Harvey P. Dale, Dec 05 2023 *)

Formula

From Chai Wah Wu, Jan 28 2024: (Start)
a(n) = 2*a(n-1) - a(n-2) for n > 7.
G.f.: x*(-x^6 + x^5 - x^4 + x^3 - x^2 + x + 1)/(x - 1)^2. (End)

A360061 Lexicographically earliest increasing sequence such that a(1) = 2 and for n >= 2, a(1)^2 + a(2)^2 + ... + a(n)^2 is a prime.

Original entry on oeis.org

2, 3, 4, 12, 48, 54, 66, 138, 144, 162, 168, 180, 198, 234, 252, 264, 330, 360, 366, 372, 402, 420, 444, 462, 480, 534, 546, 552, 564, 576, 600, 630, 642, 678, 702, 744, 756, 846, 852, 858, 882, 966, 1008, 1206, 1242, 1254, 1266, 1272, 1296, 1302, 1338, 1650
Offset: 1

Views

Author

Win Wang, Jan 23 2023

Keywords

Examples

			For n >= 2, partial sums of squares are (showing primality): 2^2 + 3^2 = 13; 13 + 4^2 = 29; 29 + 12^2 = 173; 173 + 48^2 = 2477; ...
		

Crossrefs

Programs

  • Haskell
    import Math.NumberTheory.Primes.Testing (isPrime)
    a360061_list = 2 : 3 : recurse 4 13 where
      recurse n p
        | isPrime(n^2 + p) = n : recurse (n+1) (n^2 + p)
        | otherwise        = recurse (n+1) p
    -- Peter Kagey, Jan 25 2023
  • Maple
    s:= proc(n) option remember; `if`(n<1, 0, a(n)^2+s(n-1)) end:
    a:= proc(n) option remember; local k, m;
          k:= s(n-1); for m from 1+a(n-1)
          while not isprime(k+m^2) do od; m
        end: a(1):=2:
    seq(a(n), n=1..52);  # Alois P. Heinz, Jan 26 2023
  • Mathematica
    s[n_] := s[n] = If[n < 1, 0, a[n]^2 + s[n-1]];
    a[n_] := a[n] = Module[{k, m},
       k = s[n-1]; For[m = 1 + a[n-1],
       !PrimeQ[k + m^2], m++]; m];
    a[1] = 2;
    Table[a[n], {n, 1, 52}] (* Jean-François Alcover, Feb 03 2025, after Alois P. Heinz *)
Showing 1-6 of 6 results.