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
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
-
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
-
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 *)
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
-
# See A280028 for Maple program
-
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 *)
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
-
# See A280028 for Maple program
-
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 *)
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
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.
Definition clarified, sequence extended beyond 25 by
R. J. Mathar, May 31 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
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,...
-
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
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
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}.
-
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
Showing 1-7 of 7 results.
Comments