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

A141437 Complement of A141436.

Original entry on oeis.org

2, 4, 6, 7, 9, 12, 13, 18, 19, 21, 23, 26, 28, 29, 34, 37, 42, 43, 45, 47, 52, 53, 57, 60, 61, 65, 71, 73, 74, 79, 81, 84, 89, 91, 95, 97, 98, 101, 103, 106, 107, 112, 113, 119, 128, 131, 133, 135, 137, 139, 141, 143, 147, 149, 151, 163, 165, 167, 170, 173, 177, 180, 181, 192
Offset: 1

Views

Author

Daniel Tisdale, Aug 06 2008

Keywords

A280028 a(1)=1; thereafter, if n even, a(n) = a(n-1)-st prime, and if n odd, a(n) = a(n-1)-st nonprime.

Original entry on oeis.org

1, 2, 4, 7, 12, 37, 52, 239, 301, 1993, 2338, 20753, 23356, 266587, 291968, 4134187, 4446630, 75947059, 80652283, 1625456353, 1710094788, 39954587527, 41737658509, 1114336791787, 1157634258442, 34900173534517, 36096139358620, 1216553712004063
Offset: 1

Views

Author

N. J. A. Sloane, Dec 25 2016

Keywords

Comments

This is the sequence S_1 mentioned in A141436. The primes and nonprimes alternate.

Crossrefs

Programs

  • Maple
    P:=n->ithprime(n);
    # let b1 be a list of the nonprimes (from the b-file for A018252)
    N:=n->if n<=nops(b1) then b1[n] else 0; fi;;
    f:=proc(m) local S,n,sw,t; global P,N;
    S:=[m]; t:=m;
       if isprime(m) then sw:=1; else sw:=2; fi;
    if sw=1 then
       for n from 2 to 60 do
       if n mod 2 = 0 then t:=N(t); if t=0 then return(S); fi; else t:=P(t); fi; S:=[op(S),t];
       od:
    else
       for n from 2 to 60 do
       if n mod 2 = 0 then t:=P(t); else t:=N(t); if t=0 then return(S); fi; fi; S:=[op(S),t];
       od:
    fi;
    S;
    end;
    f(1); # A280028
    f(3); # A280029
    f(5); # A280030
  • Mathematica
    nonPrime[n_Integer] := FixedPoint[n + PrimePi@# &, n + PrimePi@ n]; a[n_] := If[ OddQ@ n, nonPrime[ a[n -1]], Prime@a[n -1]]; a[1] = 1; Array[a, 26] (* Robert G. Wilson v, Dec 28 2016 *)

Extensions

a(13)-a(27) from Hans Havermann, Dec 25 2016
a(28) from Chai Wah Wu, Dec 26 2016

A280029 a(1)=3; thereafter, if n odd, a(n) = a(n-1)-st prime, and if n even, a(n) = a(n-1)-st nonprime.

Original entry on oeis.org

3, 6, 13, 21, 73, 98, 521, 636, 4721, 5439, 53323, 59318, 737183, 801235, 12215237, 13068626, 238205651, 251987681, 5381022817, 5644769560, 138933578143, 144807081479, 4053430178401, 4203399920996, 132332669898119, 136669373292795, 4793783797371011
Offset: 1

Views

Author

N. J. A. Sloane, Dec 25 2016

Keywords

Comments

This is the sequence S_2 mentioned in A141436. The primes and nonprimes alternate.

Crossrefs

Programs

  • Maple
    # See A280028 for Maple program
  • Mathematica
    nonPrime[n_Integer] := FixedPoint[n + PrimePi@# &, n + PrimePi@ n]; a[n_] := a[n] = If[OddQ@ n, Prime@ a[n -1], nonPrime[ a[n -1]]]; a[1] = 3; Array[a, 22] (* Robert G. Wilson v, Dec 28 2016 *)

Extensions

a(12)-a(26) from Hans Havermann, Dec 25 2016
a(27) from Chai Wah Wu, Dec 27 2016

A280030 a(1)=5; thereafter, if n odd, a(n) = a(n-1)-st prime, and if n even, a(n) = a(n-1)-st nonprime.

Original entry on oeis.org

5, 9, 23, 34, 139, 180, 1069, 1274, 10399, 11815, 125933, 138847, 1854341, 2003514, 32513171, 34639222, 667169599, 703599332, 15783876803, 16518738034, 425079924023, 442239042120, 12891534052099, 13348915604303, 436194466471661
Offset: 1

Views

Author

N. J. A. Sloane, Dec 25 2016

Keywords

Comments

This is the sequence S_3 mentioned in A141436. The primes and nonprimes alternate.

Crossrefs

Programs

  • Maple
    # See A280028 for Maple program
  • Mathematica
    nonPrime[n_Integer] := FixedPoint[n + PrimePi@# &, n + PrimePi@n]; a[n_] := If[OddQ@ n, Prime@ a[n -1], nonPrime[ a[n -1]]]; a[1] = 5; Array[a, 24] (* Robert G. Wilson v, Dec 28 2016 *)

Extensions

a(12)-a(23) from Chai Wah Wu, Dec 25 2016
a(24) from Hans Havermann, Dec 25 2016
a(25) from Chai Wah Wu, Dec 26 2016

A160966 Starting from a(1)=2, a(n) = A028260(1+a(n-1)) if n is even, a(n) = A026424(a(n-1)) if n is odd.

Original entry on oeis.org

2, 6, 11, 25, 45, 94, 176, 361, 700, 1405, 2752, 5533, 10964, 22011, 43839, 87868, 175557, 351746, 703243, 1407705, 2814709, 5631461, 11261009, 22524901, 45044446, 90091251, 180165450, 360333977, 720640449, 1441293048, 2882532607
Offset: 1

Views

Author

Daniel Tisdale, May 31 2009

Keywords

Comments

If a(1) were set to 3, the equivalent sequence would start 3, 9, 17, 38, 71, 146, 279,...
Alternatively starting from a(1)=4 we get 4, 10, 18, 39, 72, 150,..

Examples

			a(2)= 6, the second integer containing an even number of prime factors.
a(3)= 11, the sixth integer containing an odd number of primes.
		

Crossrefs

Extensions

Definition clarified, sequence extended beyond 25 by R. J. Mathar, May 31 2010
a(15)-a(31) from Donovan Johnson, Jul 02 2010

A161185 First column of a table of all primes sorted by recursive look-up depending on the primality of their indices.

Original entry on oeis.org

2, 3, 7, 11, 17, 19, 29, 31, 37, 41, 43, 47, 53, 67, 71, 73, 79, 83, 89, 97, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 181, 191, 193, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 271, 277, 281, 283, 293, 307, 311, 313, 317, 337, 347, 349
Offset: 1

Views

Author

Daniel Tisdale, Jun 05 2009

Keywords

Comments

We start from two lists of primes according to whether their indices are prime or nonprime, the first list being A007821, the second A006450:
2,7,13,19,23,29,37,43,47,53,61,71,73,79,89,..
3,5,11,17,31,41,59,67,83,109,127,157,179,191,..
We construct rows of an intermediate table by transversing this double list, basically reading a number, then using this number as an index into the other list, reading the prime there, using it again as an index into the original list etc, alternating between the two lists.
A new row is started from the smallest prime not contained in any earlier row (the "generator" of this row). The first row starts with 2, takes the 2nd entry of the other list (which is 5), takes the 5th entry from the original list (which is 23), then the 23rd entry of the other list etc. The 2nd row starts with 3 (the smallest prime not in the first row), takes the 3rd entry from the first list (which is 13), then the 13th entry from the 2nd list (which is 179), etc.
By construction, the table contains each prime exactly once. The first column with the generators defines the sequence.

Examples

			The table with the generator in the first column and followup primes in the same row starts:
  2,5,23,431,3821,...
  3,13,179,1439,...
  7,59,419,...
  11,61,1847,...
  17,101,3943,...
  19,331,2833,...
  29,599,5507,...
  31,197,9739,...
  37,919,8861,...
  41,269,...
  43,1153,...
  47,1297,...
		

Crossrefs

Cf. A141436.

Programs

  • PARI
    lista(nn) = my(v = primes(nn), vp = select(x->isprime(primepi(x)), v), vc = setminus(v, vp), list = List()); while (#v, my(p=v[1], q); listput(list, p); v = setminus(v, [p]); my(ok = 1); while(ok, if (vecsearch(vp, p), vx=vc; vy=vp, vx=vp; vy=vc); if (p > #vx, ok = 0, q = vx[p]; v = setminus(v, [q]); if (q > #vy, ok = 0, q = vy[q]; v = setminus(v, [q]); p = q;);););); Vec(list); \\ Michel Marcus, Oct 31 2022

Extensions

Edited and extended by R. J. Mathar, Jun 23 2009
More terms from Michel Marcus, Oct 31 2022

A161186 In the sequence of nonprime numbers, an element k's position is either prime or nonprime. If k's position is prime, f(k)= the k-th nonprime-positioned element, else f(k) is the k-th prime-positioned element. Iterated application of x-> f(x) gives disjoint sequences generated by the first elements, which form the current sequence.

Original entry on oeis.org

1, 6, 8, 9, 10, 12, 15, 18, 20, 21, 22, 25, 26, 27, 32, 33, 34, 35, 36, 38, 40, 44, 45, 48, 49, 50, 51, 52, 55, 57, 58, 62, 63, 64, 66, 69, 70, 72, 75, 76, 77, 78, 81, 82, 84, 85, 87, 88, 90, 91, 92, 93, 94, 98, 99, 100, 102, 104, 108, 110, 112, 114, 115, 116, 117, 120
Offset: 1

Views

Author

Daniel Tisdale, Jun 05 2009, Jun 10 2009

Keywords

Examples

			The nonprime numbers are: [1, 4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20].
Those with prime positions are: [4, 6, 9, 12, 18].
Those with nonprime positions are: [1, 8, 10, 14, 15, 16, 20].
So we have {f(1)} = {1,4,14,60,...}, {f(6)} = {6,16,74,...}, {f(8)} ={8,28,56,...}; so the current sequence are the first elements, {1,6,8,...etc}.
		

Crossrefs

Programs

  • PARI
    lista(nn) = {my(va = select(x->(! isprime(x)), [1..nn])); my(vap = vector(primepi(#va), k, va[prime(k)])); my(vanp = Vec(setminus(va, vap))); my(vused = vector(#va), ok=1, last=0, list=List(), new, ok2); while(ok, last++; while ((last <= #vused) && vused[last], last++); if (last > #vused, break); new = va[last]; listput(list, new); ok2 = 1; my(list1 = List()); listput(list1, new); while(ok2, pos = setsearch(va, new); if (!pos, ok2=0, vused[pos] = 1; if (isprime(pos), if (new <= #vanp, new = vanp[new], ok2=0), if (new <= #vap, new = vap[new], ok2=0);); listput(list1, new);););); Vec(list);} \\ Michel Marcus, Aug 18 2022

Extensions

More terms from Michel Marcus, Aug 18 2022
Showing 1-7 of 7 results.