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

A298465 The first of two consecutive heptagonal numbers the sum of which is equal to the sum of two consecutive primes.

Original entry on oeis.org

1, 18, 403, 16281, 24354, 167314, 172528, 183196, 191407, 223054, 413512, 446688, 476767, 507826, 512343, 791578, 926289, 994456, 1032658, 1248562, 1284147, 2221708, 2278630, 2453716, 2604571, 2738952, 2770443, 3207523, 3333330, 4203577, 4400332, 4628761
Offset: 1

Views

Author

Colin Barker, Jan 19 2018

Keywords

Examples

			18 is in the sequence because 18+34 (consecutive heptagonal numbers) = 52 = 23+29 (consecutive primes).
		

Crossrefs

Programs

  • Mathematica
    chcpQ[{a_,b_}]:=Module[{c=(a+b)/2},NextPrime[c]+ NextPrime[c,-1] ==a+b]; Select[ Partition[PolygonalNumber[7,Range[2000]],2,1],chcpQ][[;;,1]] (* Harvey P. Dale, Mar 14 2023 *)
  • PARI
    L=List(); forprime(p=2, 6000000, q=nextprime(p+1); t=p+q; if(issquare(20*t-16, &sq) && (sq-2)%10==0, u=(sq-2)\10; listput(L, (5*u^2-3*u)/2))); Vec(L)
    
  • Python
    from sympy import prevprime, nextprime
    A298465_list, n, m = [], 1 ,8
    while len(A298465_list) < 10000:
        k = prevprime(m//2)
        if k + nextprime(k) == m:
            A298465_list.append(n*(5*n-3)//2)
        n += 1
        m += 10*n-3 # Chai Wah Wu, Jan 19 2018

A298466 The first of two consecutive primes the sum of which is equal to the sum of two consecutive heptagonal numbers.

Original entry on oeis.org

3, 23, 433, 16481, 24593, 167953, 173183, 183871, 192097, 223781, 414521, 447743, 477857, 508951, 513473, 792983, 927803, 996019, 1034251, 1250309, 1285937, 2224063, 2281003, 2456191, 2607109, 2741561, 2773073, 3210353, 3336209, 4206817, 4403647, 4632161
Offset: 1

Views

Author

Colin Barker, Jan 19 2018

Keywords

Examples

			23 is in the sequence because 23+29 (consecutive primes) = 52 = 18+34 (consecutive heptagonal numbers).
		

Crossrefs

Programs

  • Mathematica
    Module[{hep=Total/@Partition[PolygonalNumber[7,Range[1500]],2,1]},Select[ Partition[Prime[Range[PrimePi[Max[hep]/2]]],2,1],MemberQ[hep,Total[#]]&]][[All,1]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Dec 04 2019 *)
  • PARI
    L=List(); forprime(p=2, 6000000, q=nextprime(p+1); t=p+q; if(issquare(20*t-16, &sq) && (sq-2)%10==0, u=(sq-2)\10; listput(L, p))); Vec(L)
    
  • Python
    from sympy import prevprime, nextprime
    A298466_list, n, m = [], 1 ,8
    while len(A298466_list) < 10000:
        k = prevprime(m//2)
        if k + nextprime(k) == m:
            A298466_list.append(k)
        n += 1
        m += 10*n-3 # Chai Wah Wu, Jan 19 2018

A206281 Smallest of five consecutive primes whose sum is a square.

Original entry on oeis.org

181, 199, 317, 3529, 3733, 4177, 4663, 9049, 15329, 15991, 19577, 24907, 43607, 47017, 58073, 84223, 86843, 146191, 152417, 156623, 175543, 217559, 227671, 288461, 308999, 323077, 331249, 333323, 354301, 390289, 397037, 407249, 474923, 476137, 491059, 520339
Offset: 1

Views

Author

Harvey P. Dale, Feb 05 2012

Keywords

Examples

			a(4) = 3529. The next four primes are 3533, 3539, 3541, and 3547, and the sum of all five primes = 17689 = 133^2.
		

Crossrefs

Programs

  • Maple
    count:= 0: Res:= NULL:
    for y from 10 while count < 100 do
      target:= y^2;
      t:= prevprime(ceil(target/5));
      s:= prevprime(t);
      r:= prevprime(s);
      q:= prevprime(r);
      p:= prevprime(q);
      u:= p+q+r+s+t;
      while u < target do
        p:= q; q:= r; r:= s; s:= t; t:= nextprime(t);
        u:= p+q+r+s+t;
      od;
      if u = target then
         count:= count+1; Res:= Res, p;
      fi
    od:
    Res; # Robert Israel, Oct 20 2020
  • Mathematica
    Transpose[Select[Partition[Prime[Range[80000]],5,1],IntegerQ[Sqrt[ Total[#]]]&]][[1]]

A225077 Smaller of the two consecutive primes whose sum is a triangular number.

Original entry on oeis.org

17, 37, 59, 103, 137, 149, 313, 467, 491, 883, 911, 1277, 1423, 1619, 1783, 2137, 2473, 2729, 4127, 4933, 5437, 5507, 6043, 6359, 10039, 10453, 11717, 13397, 15809, 17489, 20807, 21821, 23027, 27631, 28307, 28813, 29669, 33029, 36947, 39103, 44203, 48281
Offset: 1

Views

Author

Alex Ratushnyak, May 28 2013

Keywords

Crossrefs

Cf. A175132 (numbers n such that sum of two consecutive primes is triangular(n)).
Cf. A181902 and A154634 (average of two consecutive primes is a triangular number).
Cf. A075190 and A225195 (average of two consecutive primes is a square).
Cf. A074924 and A061275 (sum of two consecutive primes is a square).

Programs

  • Maple
    f:= proc(n) local m,p,q;
      m:= n*(n+1)/2;
      p:= prevprime(ceil(m/2));
      q:= nextprime(p);
      if p+q=m then p fi
    end proc:
    map(f, [$3..500]); # Robert Israel, May 04 2020
  • Mathematica
    tri[n_] := IntegerQ[Sqrt[1 + 8 n]]; t = {}; p1 = 2; While[Length[t] < 50, p2 = NextPrime[p1]; If[tri[p1 + p2], AppendTo[t, p1]]; p1 = p2]; t (* T. D. Noe, May 28 2013 *)

Formula

a(n) + nextprime(a(n)) = A000217(A175132(n)).

A247302 Rectangular array read upwards by columns: T = T(n,k) = number of paths from (0,1) to (n,k), where 0 >= k <= 2, consisting of segments given by the vectors (1,1), (2,1), (1,-1).

Original entry on oeis.org

0, 1, 0, 1, 0, 1, 0, 2, 1, 2, 2, 2, 2, 4, 4, 4, 8, 6, 8, 12, 12, 12, 24, 20, 24, 40, 36, 40, 72, 64, 72, 128, 112, 128, 224, 200, 224, 400, 352, 400, 704, 624, 704, 1248, 1104, 1248, 2208, 1952, 2208, 3904, 3456, 3904, 6912, 6112, 6912, 12224, 10816, 12224
Offset: 0

Views

Author

Clark Kimberling, Sep 11 2014

Keywords

Examples

			First 10 columns:
0 .. 1 .. 1 .. 2 .. 4 .. 6 .. 12 .. 20 .. 36 .. 64
1 .. 0 .. 2 .. 2 .. 4 .. 8 .. 12 .. 24 .. 40 .. 72
0 .. 1 .. 0 .. 2 .. 2 .. 4 .. 8 ... 12 .. 24 .. 40
T(4,1) counts these 4 paths, given as vector sums applied to (0,0):
(1,1) + (1,-1) + (1,1) + (1,-1);
(1,1) + (1,-1) + (1,-1) + (1,1);
(1,-1) + (1,1) + (1,-1) + (1,1);
(1,-1) + (1,1) + (1,1) + (1,-1).
		

Crossrefs

Cf. A247050, A247301, A061275 (column sums).

Programs

  • Mathematica
    t[0, 0] = 0; t[0, 1] = 1; t[0, 2] = 0;
    t[1, 0] = 1; t[1, 1] = 0; t[1, 2] = 1;
    t[2, 0] = 0; t[2, 1] = 2; t[2, 2] = 1; t[n_, 0] := t[n, 0] = t[n - 1, 1];
    t[n_, 1] := t[n, 1] = t[n - 1, 0] + t[n - 1, 2] + t[n - 2, 0];
    t[n_, 2] := t[n, 2] = t[n - 1, 1] + t[n - 2, 1];
    TableForm[Reverse[Transpose[Table[t[n, k], {n, 0, 12}, {k, 0, 2}]]]]
    Flatten[Table[t[n, k], {n, 0, 20}, {k, 0, 2}]]   (* A247302 *)

Formula

(row 0, the bottom row): r(n) = 2*r(n-2) + 2*r(n-3), with r(0) = 0, r(1) = 1, r(2) = 0;
(row 1, the middle row): r(n) = 2*r(n-2) + 2*r(n-3), with r(0) = 1, r(1) = 0, r(2) = 2;
(row 2, the top row): r(n) = 2*r(n-2) + 2*r(n-3), with r(0) = 0, r(1) = 1, r(2) = 1.
From Chai Wah Wu, Jan 24 2020: (Start)
a(n) = 2*a(n-6) + 2*a(n-9) for n > 8.
G.f.: (-x^8 - x^5 - x^3 - x)/(2*x^9 + 2*x^6 - 1). (End)

A118591 Larger of two consecutive primes whose sum is a square.

Original entry on oeis.org

19, 53, 73, 293, 883, 1153, 1931, 2593, 3529, 4051, 6053, 7207, 7451, 15139, 20809, 21647, 24203, 26921, 28807, 34849, 46819, 53147, 56453, 69193, 74507, 83233, 84053, 98573, 103067, 103969, 109517, 110459, 112339, 136247, 149059, 151253
Offset: 1

Views

Author

Cino Hilliard, May 08 2006

Keywords

Examples

			17 and 19 are consecutive primes whose sum is 36, a square, so 19 is a term.
		

Crossrefs

Programs

  • Mathematica
    Transpose[Select[Partition[Prime[Range[14000]],2,1],IntegerQ[ Sqrt[ Total[#]]]&]] [[2]] (* Harvey P. Dale, May 03 2012 *)
  • PARI
    g(n) = for(x=2,n,if(issquare(prime(x)+prime(x-1)),print1(prime(x)",")))
    
  • PARI
    lista(pmax) = {my(p1 = 2); forprime(p2 = 3, pmax, if(issquare(p1 + p2), print1(p2, ", ")); p1 = p2);} \\ Amiram Eldar, Jul 12 2024

Formula

a(n) = A151800(A061275(n)). - Amiram Eldar, Jul 12 2024
Previous Showing 11-16 of 16 results.