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.

A073666 Rearrangement of natural numbers such that a(k)*a(k+1) + 1 is a prime for all k.

Original entry on oeis.org

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

Views

Author

Amarnath Murthy, Aug 10 2002

Keywords

Crossrefs

Programs

  • Mathematica
    a[1]=1; a[n_]:=a[n]=(For[c=Sort[Table[a[k], {k, n-1}]]; d=Append[c, Last[c]+1]; m=First[Complement[Range[Last[d]], c]], MemberQ[c, m]||!PrimeQ[m*a[n-1]+1], m++ ]; m); Table[a[k], {k, 70}] (* Farideh Firoozbakht, Apr 14 2004 *)
  • PARI
    A073666(n,show=1,a=1,u=[a])={for(n=2,n,show&&print1(a",");for(k=u[1]+1,9e9,!setsearch(u,k) && isprime(a*k+1) && (a=k) && break);u=setunion(u,[a]); while(#u>1&&u[2]==u[1]+1,u=u[2..-1]));a} \\ Use 2nd, 3rd or 4th optional arg to display intermediate terms, to use another starting value, to exclude some terms. - M. F. Hasler, Nov 24 2015

Extensions

More terms from Jason Earls, Aug 26 2002
Offset changed to 1 by Ivan Neretin, Mar 06 2016

A081942 a(1) = 1, a(n) = smallest number greater than a(n-1) such that a(n-1)*a(n) + 1 is prime.

Original entry on oeis.org

1, 2, 3, 4, 7, 10, 13, 24, 25, 28, 34, 37, 40, 43, 46, 51, 56, 60, 67, 70, 79, 84, 87, 94, 105, 106, 120, 126, 130, 133, 136, 147, 148, 151, 156, 161, 162, 163, 166, 171, 176, 177, 184, 190, 193, 204, 208, 211, 228, 234, 239, 242, 248, 252, 256, 262, 265, 270
Offset: 1

Views

Author

Amarnath Murthy, Apr 02 2003

Keywords

Comments

See A073666 for a nonincreasing version and A096100 for a more restrictive constraint. - M. F. Hasler, Nov 24 2015

Crossrefs

Programs

  • Mathematica
    f[s_List] := Block[{k = m = s[[-1]]}, k++; While[ !PrimeQ[k*m + 1], k++]; Append[s, k]]; Nest[f, {1}, 57] (* Robert G. Wilson v, Dec 02 2012 *)
    smp[n_]:=Module[{m=n+1},While[!PrimeQ[m*n+1],m++];m]; NestList[smp,1,60] (* Harvey P. Dale, Dec 12 2018 *)
  • PARI
    A081942(n,show=0,a=1)={for(n=2,n,show&&print1(a",");for(k=a+1,9e9, isprime(a*k+1) && (a=k) && break));a} \\ Use 2nd or 3rd optional arg to print intermediate terms or to use another starting value. - M. F. Hasler, Nov 24 2015

Extensions

More terms from Gabriel Cunningham (gcasey(AT)mit.edu), Apr 08 2003

A096101 a(1) = 1; for n > 1: a(n) = smallest number >1 such that product of any two or more successive terms - 1 is prime.

Original entry on oeis.org

1, 3, 2, 2, 2, 3, 170, 46600, 1901907, 65157236, 42083217792, 2819475721641
Offset: 1

Views

Author

Amarnath Murthy, Jun 24 2004

Keywords

Examples

			a(2) is not 2 since 1*2-1 = 1 is not prime, but 1*3-1 = 2 is prime, hence a(2) = 3.
a(6) is not 2 since 2*2*2*2-1 = 15 is not prime, but 2*3-1 = 5, 2*2*3-1 = 11, 2*2*2*3-1 = 23, 3*2*2*2*3-1 = 71 are all prime, hence a(6) = 3.
		

Crossrefs

Cf. A096100.

Extensions

Edited and extended by Klaus Brockhaus, Jul 05 2004
a(10) from Donovan Johnson, Apr 22 2008
a(11)-a(12) from Bert Dobbelaere, Jan 13 2020

A096102 a(1) = 1, a(2) = 3; for n > 2: a(n) = smallest (odd) number not occurring earlier such that the sum of each section of odd length >=3 is prime.

Original entry on oeis.org

1, 3, 7, 9, 21, 13
Offset: 1

Views

Author

Amarnath Murthy, Jun 24 2004

Keywords

Comments

If 1, 3, 7, 13 are taken (rather arbitrarily) as starting terms, then the continuation is 17, 31, 11, 25, 5, 37, 341, 163, 647, 571, 989, 3451, 17669, 206413, 6767, 252289, but no number < 10000000 is suited to continue this sequence further.
There are no further terms. For k to qualify as next term the sums 21+13+k, 7+9+21+13+k and 1+3+7+9+21+13+k have to be prime. One of these sums however is divisible by 3, since 34+k = k+1 (mod 3), 50+k = k+2 (mod 3) and 54+k = k (mod 3). - Klaus Brockhaus, Jul 02 2004

Examples

			1+3+7 = 11, 3+7+9 = 19, 7+9+21 = 37, 9+21+13 = 43, 1+3+7+9+21 = 41, 3+7+9+21+13 = 53 are all prime.
		

Crossrefs

Extensions

Edited and corrected by Klaus Brockhaus, Jun 29 2004
Showing 1-4 of 4 results.