OFFSET
1,2
COMMENTS
Permutation of odd numbers.
For n >= 2, a(n) = A078898(n)-th number k for which A055396(k) = A055396(n)+1. In other words, a(n) tells which number is located immediately below n in the sieve of Eratosthenes (see A083140, A083221) in the same column of the sieve that contains n.
A250471(n) = (a(n)+1)/2 is a permutation of natural numbers.
Coincides with A003961 in all terms which are primes. - M. F. Hasler, Sep 17 2016. Note: primes are a proper subset of A280693 which gives all n such that a(n) = A003961(n). - Antti Karttunen, Mar 08 2017
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..5002
FORMULA
MATHEMATICA
a[1] = 1; a[n_] := If[PrimeQ[n], NextPrime[n], m1 = p1 = FactorInteger[n][[ 1, 1]]; For[k1 = 1, m1 <= n, m1 += p1; If[m1 == n, Break[]]; If[ FactorInteger[m1][[1, 1]] == p1, k1++]]; m2 = p2 = NextPrime[p1]; For[k2 = 1, True, m2 += p2, If[FactorInteger[m2][[1, 1]] == p2, k2++]; If[k1+2 == k2, Return[m2]]]]; Array[a, 100] (* Jean-François Alcover, Mar 08 2016 *)
g[n_] := If[n == 1, 0, PrimePi@ FactorInteger[n][[1, 1]]]; Function[s, MapIndexed[Lookup[s, g[First@ #2] + 1][[#1]] - Boole[First@ #2 == 1] &, #] &@ Map[Position[Lookup[s, g@#], #][[1, 1]] &, Range@ 120]]@ PositionIndex@ Array[g, 10^4]] (* Michael De Vlieger, Mar 08 2017, Version 10 *)
PROG
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Dec 06 2014
STATUS
approved