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

A100555 Smallest square that is equal to the sum of n not-necessarily-distinct primes plus 1.

Original entry on oeis.org

1, 4, 9, 9, 9, 16, 16, 16, 25, 25, 25, 25, 25, 36, 36, 36, 36, 36, 49, 49, 49, 49, 49, 49, 49, 64, 64, 64, 64, 64, 64, 64, 81, 81, 81, 81, 81, 81, 81, 81, 81, 100, 100, 100, 100, 100, 100, 100, 100, 100, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 144, 144
Offset: 0

Views

Author

Giovanni Teofilatto, Dec 31 2004

Keywords

Examples

			a(1)=4 because 2^2=1+3.
a(2)=9 because 3^2=1+3+5.
a(3)=9 because 3^2=1+2+3+3.
a(4)=9 because 3^2=1+2+2+2+2.
		

Crossrefs

Extensions

Corrected and extended by Ray Chandler, Jan 10 2005

A101778 Last term in each row of triangle referenced in A101777.

Original entry on oeis.org

3, 5, 3, 2, 7, 5, 3, 7, 7, 5, 3, 2, 11, 7, 7, 5, 3, 13, 11, 7, 7, 5, 3, 2, 13, 13, 11, 7, 7, 5, 3, 17, 13, 13, 11, 7, 7, 5, 3, 2, 19, 17, 13, 13, 11, 7, 7, 5, 3, 19, 19, 17, 13, 13, 11, 7, 7, 5, 3, 2, 23, 19, 19, 17, 13, 13, 11, 7, 7, 5, 3, 23, 23, 19, 19, 17, 13, 13, 11, 7, 7, 5, 3, 2, 23
Offset: 1

Views

Author

Ray Chandler, Jan 10 2005

Keywords

Crossrefs

Programs

  • PARI
    A020482(k) = forprime(q=2, k, if(isprime(2*k-q), return(2*k-q)));
    a(n) = {my(r=(ceil(sqrt(2*n+1)))^2-2*n+3); if(r%2==0, r=A020482(r/2), if(isprime(r-2), r-=2, r=A020482(r\2))); r; } \\ Jinyuan Wang, Jan 29 2020

Formula

a(n) = A101777(A000217(n)).

A101777 Triangle read by rows where n-th row is the lexicographically least set of n not-necessarily-distinct primes summing to A100555(n)-1.

Original entry on oeis.org

3, 3, 5, 2, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 7, 2, 2, 2, 2, 2, 5, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 5, 7, 2, 2, 2, 2, 2, 2, 2, 3, 7, 2, 2, 2, 2, 2, 2, 2, 2, 3, 5, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 11, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 7
Offset: 1

Views

Author

Ray Chandler, Jan 10 2005

Keywords

Examples

			Triangle begins:
  {3}
  {3,5}
  {2,3,3}
  {2,2,2,2}
  {2,2,2,2,7}
  {2,2,2,2,2,5}
  {2,2,2,2,2,2,3}
  {2,2,2,2,2,2,5,7}
  {2,2,2,2,2,2,2,3,7}
  {2,2,2,2,2,2,2,2,3,5}
  {2,2,2,2,2,2,2,2,2,3,3}
  {2,2,2,2,2,2,2,2,2,2,2,2}
  {2,2,2,2,2,2,2,2,2,2,2,2,11}
  {2,2,2,2,2,2,2,2,2,2,2,3,3,7}
  {2,2,2,2,2,2,2,2,2,2,2,2,2,2,7}
		

Crossrefs

Extensions

Row 8 of table corrected at the suggestion of Jinyuan Wang by Ray Chandler, Jan 28 2020

A333615 a(n) is the number of ways to express 2*n+1 as a sum of parts x such that x+2 is an odd prime.

Original entry on oeis.org

1, 2, 3, 4, 7, 10, 13, 20, 26, 34, 48, 61, 78, 103, 129, 162, 206, 256, 314, 391, 479, 579, 711, 859, 1028, 1243, 1485, 1764, 2107, 2497, 2941, 3477, 4092, 4783, 5610, 6557, 7615, 8872, 10303, 11901, 13781, 15910, 18292, 21062, 24196, 27697, 31726, 36287
Offset: 0

Views

Author

Luc Rousseau, Mar 29 2020

Keywords

Examples

			For n = 3, 2*n + 1 = 7. There are 4 partitions of 7 into parts with sizes 1, 3, 5, 9, 11 ... (the odd primes minus 2):
7 = 5 + 1 + 1
7 = 3 + 3 + 1
7 = 3 + 1 + 1 + 1 + 1
7 = 1 + 1 + 1 + 1 + 1 + 1 + 1
So, a(3) = 4.
		

Crossrefs

Cf. A069259 (partitions of 2*n, instead of 2*n+1).
Cf. A101776.

Programs

  • Mathematica
    a[n_] := Module[{p},
      p = Table[Prime[i] - 2, {i, 2, PrimePi[2*n + 3]}];
      Length[IntegerPartitions[2*n + 1, {0, Infinity}, p]]]
    Table[a[n], {n, 0, 60}]
  • PARI
    \\ Slowish:
    partitions_into(n,parts,from=1) = if(!n,1, if(#parts==from, (0==(n%parts[from])), my(s=0); for(i=from,#parts,if(parts[i]<=n, s += partitions_into(n-parts[i],parts,i))); (s)));
    odd_primes_minus2_upto_n_reversed(n) = { my(lista=List([])); forprime(p=3,n+2,listput(lista,p-2)); Vecrev(Vec(lista)); };
    A333615(n) = partitions_into(n+n+1, odd_primes_minus2_upto_n_reversed(n+n+1)); \\ Antti Karttunen, May 09 2020
Showing 1-4 of 4 results.