%I #47 Sep 09 2017 19:28:52
%S 1,3,5,9,7,15,11,21,25,27,13,33,17,39,35,45,19,51,23,57,55,63,29,69,
%T 49,75,65,81,31,87,37,93,85,99,77,105,41,111,95,117,43,123,47,129,115,
%U 135,53,141,121,147,125,153,59,159,91,165,145,171,61,177,67,183,155,189,119,195,71,201,175,207,73,213,79,219,185,225,143,231,83,237,205,243,89,249,133,255
%N a(1) = 1; and for n > 1, a(n) = A078898(n)-th number k for which A055396(k) = A055396(n)+1, where A055396(n) is the index of smallest prime dividing n.
%C Permutation of odd numbers.
%C 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.
%C A250471(n) = (a(n)+1)/2 is a permutation of natural numbers.
%C 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
%H Antti Karttunen, <a href="/A250469/b250469.txt">Table of n, a(n) for n = 1..5002</a>
%F a(1) = 1, a(n) = A083221(A055396(n)+1, A078898(n)).
%F a(n) = A249817(A003961(A249818(n))).
%F Other identities. For all n >= 1:
%F A250470(a(n)) = A268674(a(n)) = n. [A250470 and A268674 provide left inverses for this function.]
%F a(2n) = A016945(n-1). [Maps even numbers to the numbers of form 6n+3, in monotone order.]
%F a(A016945(n-1)) = A084967(n). [Which themselves are mapped to the terms of A084967, etc. Cf. the Example section of A083140.]
%F a(A000040(n)) = A000040(n+1). [Each prime is mapped to the next prime.]
%F For all n >= 2, A055396(a(n)) = A055396(n)+1. [A more general rule.]
%F A046523(a(n)) = A283465(n). - _Antti Karttunen_, Mar 08 2017
%t 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 *)
%t 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 *)
%o (Scheme, two alternatives)
%o (define (A250469 n) (A249817 (A003961 (A249818 n))))
%o (define (A250469 n) (if (= 1 n) n (A083221bi (+ (A055396 n) 1) (A078898 n)))) ;; Code for A083221bi given in A083221.
%Y Cf. A000040, A003961, A016945, A046523, A055396, A078898, A083140, A083221, A084967, A249744, A249810, A249820, A249817, A249818, A250471, A266645, A280692, A280693, A283465.
%Y Cf. A250470, A268674 (left inverses, the latter is simpler).
%K nonn
%O 1,2
%A _Antti Karttunen_, Dec 06 2014