A236854
Self-inverse permutation of natural numbers: a(1)=1, then a(p_n)=c_{a(n)}, a(c_n)=p_{a(n)}, where p_n = n-th prime, c_n = n-th composite.
Original entry on oeis.org
1, 4, 9, 2, 16, 7, 6, 23, 3, 53, 26, 17, 14, 13, 83, 5, 12, 241, 35, 101, 59, 43, 8, 41, 431, 11, 37, 1523, 75, 149, 39, 547, 277, 191, 19, 179, 27, 3001, 31, 157, 24, 12763, 22, 379, 859, 167, 114, 3943, 1787, 1153, 67, 1063, 10, 103, 27457, 127, 919, 89, 21
Offset: 1
a(5)=c(a(3))=c(9)=16, because 5=prime(3), and the 9th composite number is c(9)=16.
Thus a(10)=prime(a(5))=prime(16)=53 (since 10 is the 5th composite), a(18)=prime(a(10))=prime(53)=241 (since 18 is the 10th composite), a(28)=prime(a(18))=prime(241)=1523.
A significant record value is a(198) = prime(a(152)) = prime(563167303) since 198=c(152); a(152)=prime(a(115)) since 152=c(115); a(115)=prime(a(84)); a(84)=prime(a(60)); a(60)=prime(a(42)); a(42)=prime(a(28)).
Differs from
A135044 for the first time at n=8, where
A135044(8)=13, while here a(8)=23.
-
terms = 150; cc = Select[Range[4, 2 terms^2(*empirical*)], CompositeQ]; compositePi[k_?CompositeQ] := FirstPosition[cc, k][[1]]; a[1] = 1; a[p_?PrimeQ] := a[p] = cc[[a[PrimePi[p]]]]; a[k_] := a[k] = Prime[a[ compositePi[k]]]; Array[a, terms] (* Jean-François Alcover, Mar 02 2016 *)
-
A236854(n)={if(isprime(n), A002808(A236854(primepi(n))), n==1&&return(1);prime(A236854(n-primepi(n)-1)))} \\ without memoization: not much slower. - M. F. Hasler, Feb 03 2014
-
a236854=vector(999);a236854[1]=1;A236854(n)={a236854[n]&&return(a236854[n]); a236854[n]=if(isprime(n), A002808(A236854(primepi(n))), prime(A236854(n-primepi(n)-1)))} \\ Version with memoization. - M. F. Hasler, Feb 03 2014
-
from sympy import primepi, prime, isprime
def a002808(n):
m, k = n, primepi(n) + 1 + n
while m != k: m, k = k, primepi(k) + 1 + n
return m # this function from Chai Wah Wu
def a(n): return n if n<2 else a002808(a(primepi(n))) if isprime(n) else prime(a(n - primepi(n) - 1))
print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 07 2017
A236542
Array T(n,k) read along descending antidiagonals: row n contains the primes with n steps in the prime index chain.
Original entry on oeis.org
2, 7, 3, 13, 17, 5, 19, 41, 59, 11, 23, 67, 179, 277, 31, 29, 83, 331, 1063, 1787, 127, 37, 109, 431, 2221, 8527, 15299, 709, 43, 157, 599, 3001, 19577, 87803, 167449, 5381, 47, 191, 919, 4397, 27457, 219613, 1128889, 2269733, 52711
Offset: 1
The array starts:
2, 7, 13, 19, 23, 29, 37, 43, 47, 53,...
3, 17, 41, 67, 83, 109, 157, 191, 211, 241,...
5, 59, 179, 331, 431, 599, 919, 1153, 1297, 1523,...
11, 277, 1063, 2221, 3001, 4397, 7193, 9319,10631,12763,...
31, 1787, 8527,19577,27457,42043,72727,96797,112129,137077,...
-
A236542 := proc(n,k)
option remember ;
if n = 1 then
A007821(k) ;
else
ithprime(procname(n-1,k)) ;
end if:
end proc:
for d from 2 to 10 do
for k from d-1 to 1 by -1 do
printf("%d,",A236542(d-k,k)) ;
end do:
end do:
-
A007821 = Prime[Select[Range[15], !PrimeQ[#]&]];
T[n_, k_] := T[n, k] = If[n == 1, If[k <= Length[A007821], A007821[[k]], Print["A007821 must be extended"]; Abort[]], Prime[T[n-1, k]]];
Table[T[n-k+1, k], {n, 1, 9}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Apr 16 2020 *)
A136043
Period-lengths of the base-2 MR-expansions of the reciprocals of the positive integers.
Original entry on oeis.org
1, 1, 1, 1, 2, 1, 1, 1, 3, 2, 5, 1, 6, 1, 1, 1, 4, 3, 9, 2, 2, 5, 4, 1, 10, 6, 9, 1, 14, 1, 1, 1, 5, 4, 5, 3, 18, 9, 4, 2, 10, 2, 7, 5, 5, 4, 9, 1, 10, 10, 2, 6, 26, 9, 8, 1, 9, 14, 29, 1, 30, 1, 1, 1, 6, 5, 33, 4, 11, 5, 14, 3, 3, 18, 9, 9, 15, 4, 17, 2, 27, 10, 41, 2, 2, 7, 11, 5, 4, 5, 4, 4, 3, 9, 14
Offset: 1
In A136042 it is shown that the base-2 MR-expansion of 1/5 is {3,1,3,1,3,1,3,1,...}, with period-length 2, so a(5)=2.
A236536
Array T(n,k) read along antidiagonals: the composites of order of compositeness n in row n.
Original entry on oeis.org
4, 6, 9, 8, 12, 16, 10, 15, 21, 26, 14, 18, 25, 33, 39, 20, 24, 28, 38, 49, 56, 22, 32, 36, 42, 55, 69, 78, 27, 34, 48, 52, 60, 77, 94, 106, 30, 40, 50, 68, 74, 84, 105, 125, 141, 35, 45, 57, 70, 93, 100, 115, 140, 164, 184, 44, 51, 64, 80, 95, 124, 133, 152, 183, 212, 236, 46, 63, 72, 88, 110, 126, 162, 174, 198, 235, 270, 299
Offset: 1
The array starts:
4, 6, 8, 10, 14, 20, 22, 27, 30, 35,...
9, 12, 15, 18, 24, 32, 34, 40, 45, 51,...
16, 21, 25, 28, 36, 48, 50, 57, 64, 72,...
26, 33, 38, 42, 52, 68, 70, 80, 88, 98,...
39, 49, 55, 60, 74, 93, 95,110,119,130,...
56, 69, 77, 84,100,124,126,145,156,170,...
78, 94,105,115,133,162,165,188,203,218,...
106,125,140,152,174,209,213,242,259,278,...
141,164,183,198,222,266,272,305,326,348,...
-
A236536 := proc(n,k)
option remember ;
if n = 1 then
A022449(k) ;
else
A002808(procname(n-1,k)) ;
end if:
end proc:
for d from 2 to 10 do
for k from d-1 to by -1 do
printf("%3d,",A236536(d-k,k)) ;
end do:
end do:
-
Composite[n_] := FixedPoint[n + PrimePi[#] + 1&, n + PrimePi[n] + 1];
T[n_, k_] := T[n, k] = If[n == 1, Composite[If[k == 1, 1, Prime[k - 1]]], Composite[T[n - 1, k]]];
Table[T[n - k + 1, k], {n, 1, 12}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Sep 16 2023 *)
Showing 1-4 of 4 results.
Comments