A135044
a(1)=1, then a(c) = p and a(p) = c, where c = T_c(r,k) and p = T_p(r,k), and where T_p contains the primes arranged in rows by the prime index chain and T_c contains the composites arranged in rows by the order of compositeness. See Formula.
Original entry on oeis.org
1, 4, 9, 2, 16, 7, 6, 13, 3, 19, 26, 17, 8, 23, 41, 5, 12, 67, 10, 29, 59, 37, 14, 83, 179, 11, 43, 331, 20, 47, 39, 109, 277, 157, 53, 431, 22, 1063, 31, 191, 15, 2221, 27, 61, 211, 71, 30, 599, 1787, 919, 241, 3001, 35, 73, 8527, 127, 1153, 79, 21, 19577, 44, 89, 283
Offset: 1
From _Andrew Weimholt_, Jan 29 2014: (Start)
More generally, takes the primes organized in an array according to the sieving process described in the Fernandez paper:
Row[1](n) = 2, 7, 13, 19, 23, ...
Row[2](n) = 3, 17, 41, 67, 83, ...
Row[3](n) = 5, 59, 179, ...
Row[4](n) = 11, 277, ...
Lets call this T_p (n, k)
Also take the composites organized in a similar manner, except we use "composite" numbered positions in our sieve:
Row[1](n) = 4, 6, 8, 10, 14, 20, 22, ...
Row[2](n) = 9, 12, 15, 18, 24, ...
Row[3](n) = 16, 21, 25, ...
Lets call this T_c (n, k)
If we now take the natural numbers and swap each number (except for 1) with the number which holds the same spot in the other array, then we get the sequence: 1, 4, 9, 2, 16, 7, 6, 13, with for example a(8) = 13 (13 holds the same position in the 'prime' table as 8 does in the 'composite' table). (End)
Cf.
A000040,
A007097,
A049076,
A049078 -
A049081,
A058322,
A058324 -
A058328,
A093046,
A002808,
A006508,
A059981,
A078442,
A236854.
-
A135044 := proc(n)
if n = 1 then
1;
elif isprime(n) then
idx := -1 ;
for r from 1 do
for c from 1 do
if A236542(r,c) = n then
idx := [r,c] ;
end if;
if A236542(r,c) >= n then
break;
end if;
end do:
if type(idx,list) then
break;
end if;
end do:
A236536(r,c) ;
else
idx := -1 ;
for r from 1 do
for c from 1 do
if A236536(r,c) = n then
idx := [r,c] ;
end if;
if A236536(r,c) >= n then
break;
end if;
end do:
if type(idx,list) then
break;
end if;
end do:
A236542(r,c) ;
end if;
end proc: # R. J. Mathar, Jan 28 2014
-
Composite[n_Integer] := Block[{k = n + PrimePi@n + 1}, While[k != n + PrimePi@k + 1, k++ ]; k]; Compositeness[n_] := Block[{c = 1, k = n}, While[ !(PrimeQ@k || k == 1), k = k - 1 - PrimePi@k; c++ ]; c]; Primeness[n_] := Block[{c = 1, k = n}, While[ PrimeQ@k, k = PrimePi@k; c++ ]; c];
ckj[k_, j_] := Select[ Table[Composite@n, {n, 10000}], Compositeness@# == j &][[k]]; pkj[k_, j_] := Select[ Table[Prime@n, {n, 3000}], Primeness@# == j &][[k]]; f[0]=0; f[1] = 1;
f[n_] := If[ PrimeQ@ n, pn = Primeness@n; ckj[ Position[ Select[ Table[ Prime@ i, {i, 150}], Primeness@ # == pn &], n][[1, 1]], pn], cn = Compositeness@n; pkj[ Position[ Select[ Table[ Composite@ i, {i, 500}], Compositeness@ # == cn &], n][[1, 1]], cn]]; Array[f, 64] (* Robert G. Wilson v *)
A064812
Smallest prime p such that the infinite sequence {p, p'=2p-1, p''=2p'-1, ...} begins with a string of exactly n primes.
Original entry on oeis.org
5, 3, 2, 2131, 1531, 33301, 16651, 15514861, 857095381, 205528443121, 1389122693971, 216857744866621, 758083947856951, 107588900851484911, 69257563144280941
Offset: 1
a(3) = 2 because 2 is the smallest prime such that the sequence {2, 3, 5, 9, ...} begins with exactly 3 primes, where each term in the sequence is twice the preceding term minus 1.
A050440
Sixth-order composites.
Original entry on oeis.org
56, 69, 77, 78, 84, 94, 100, 105, 106, 115, 124, 125, 126, 133, 140, 141, 145, 152, 156, 162, 164, 165, 170, 174, 183, 184, 188, 198, 202, 203, 206, 209, 212, 213, 218, 222, 231, 235, 236, 242, 243, 253, 256, 258, 259, 262, 264, 266, 270, 272, 278, 284
Offset: 1
Michael Lugo (mlugo(AT)thelabelguy.com), Dec 22 1999
C(C(C(C(C(C(1)))))) = C(C(C(C(C(4))))) = C(C(C(C(9)))) = C(C(C(16))) = C(C(26)) = C(39) = 56. So 56 is in the sequence. So 77 is in the sequence.
A064960
The prime then composite recurrence; a(2n) = a(2n-1)-th prime and a(2n+1) = a(2n)-th composite and a(1) = 1.
Original entry on oeis.org
1, 2, 6, 13, 22, 79, 108, 593, 722, 5471, 6290, 62653, 69558, 876329, 951338, 14679751, 15692307, 289078661, 305618710, 6588286337, 6908033000, 171482959009, 178668550322, 5040266614919, 5225256019175, 165678678591359, 171068472492228, 6039923990345039
Offset: 1
Cf.
A007097,
A006508 &
A064961, see also
A057450,
A057451,
A057452,
A057453,
A057456 &
A057457 and
A049076,
A049077,
A049078,
A049079,
A049080 &
A049081.
-
Composite[n_Integer] := FixedPoint[n + PrimePi[ # ] + 1 &, n + PrimePi[n] + 1]; a = {1}; b = 1; Do[ If[ !PrimeQ[b], b = Prime[b], b = Composite[b]]; a = Append[a, b], {n, 1, 23}]; a
-
from functools import cache
from sympy import prime, composite
@cache
def A064960(n): return 1 if n == 1 else composite(A064960(n-1)) if n % 2 else prime(A064960(n-1)) # Chai Wah Wu, Jan 01 2022
A064961
Composite-then-prime recurrence; a(2n) = a(2n-1)-th composite and a(2n+1) = a(2n)-th prime and a(1) = 1.
Original entry on oeis.org
1, 4, 7, 14, 43, 62, 293, 366, 2473, 2892, 26317, 29522, 344249, 376259, 5429539, 5831545, 101291779, 107457490, 2198218819, 2310909505, 54720307351, 57128530327, 1543908890351, 1603146693999, 48871886538151, 50527531769529, 1720466016680911, 1772475453490311
Offset: 1
Cf.
A007097,
A006508 &
A064960, see also
A057450,
A057451,
A057452,
A057453,
A057456 &
A057457 and
A049076,
A049077,
A049078,
A049079,
A049080 &
A049081.
-
Composite[n_Integer] := FixedPoint[n + PrimePi[ # ] + 1 &, n + PrimePi[n] + 1]; a = {1, 4}; b = 4; Do[ If[ !PrimeQ[b], b = Prime[b], b = Composite[b]]; a = Append[a, b], {n, 1, 23}]; a
a(24)-a(26) corrected and a(27)-a(28) added by
Chai Wah Wu, Aug 22 2018
A058010
The main diagonal of N. Fernandez's Order of Primeness array.
Original entry on oeis.org
2, 17, 179, 2221, 27457, 506683, 14161729, 368345293, 9672485827, 318083817907, 12695664159413
Offset: 1
-
a = Select[ Range[ 20 ], ! PrimeQ[ # ] & ] Table[ Nest[ Prime, a[ [ n ] ], n ], {n, 1, 11} ]
Original entry on oeis.org
3657500101, 12055296811267, 156740126985437, 575411103069067, 966399998477597, 1841803943951113, 4176603711876241, 6373890505436101, 7910004791442043, 10613343313176589, 15000987504638299, 23825707567607467, 25462803625208449, 30634679101122821, 41400950264534519, 49969246522326097
Offset: 1
Cf.
A049076,
A006450,
A114537,
A007821,
A049078,
A049079,
A049080,
A049081,
A058322,
A058324,Cf.
A058325,
A058326,
A058327,
A058328,
A093046,
A283459.
Original entry on oeis.org
88362852307, 392654585611999, 5519908106212193, 21034688742654437, 35843152090509943, 69532764058102673, 161191749822468689, 248761474969923757, 310467261969020581, 419776921940182991, 598644471430113247, 962125183414225879, 1029970322316321083, 1244984735583648473, 1695313841631390713
Offset: 1
Cf.
A049076,
A006450,
A114537,
A007821,
A049078,
A049079,
A049080,
A049081,
A058322,
A058324,
A058325,
A058326,
A058327,
A058328,
A093046,
A283458.
A318554
a(n) is the smallest prime number having order of primeness = prime(n).
Original entry on oeis.org
3, 5, 31, 709, 9737333, 3657500101, 2586559730396077, 4123221751654370051, 28785866289100396890228041
Offset: 1
The sequence of primes with order of primeness F(p) = prime(1) = 2 begins 3,17,41,67,...
so a(1)=3. Likewise, F(p) = prime(2) = 3 begins 5,59,179,... so a(2)=5.
Comments