%I #35 Jul 02 2022 13:15:14
%S 2,3,2,5,2,3,2,7,2,3,2,5,2,3,2,11,2,3,2,5,2,3,2,7,2,3,2,5,2,3,2,13,2,
%T 3,2,5,2,3,2,7,2,3,2,5,2,3,2,11,2,3,2,5,2,3,2,7,2,3,2,5,2,3,2,17,2,3,
%U 2,5,2,3,2,7,2,3,2,5,2,3,2,11,2,3,2,5,2,3,2,7,2,3,2,5,2,3,2,13,2,3,2,5,2,3
%N a(n) = prime(A001511(n)), where A001511 is one more than the 2-adic valuation of n.
%C Originally defined as: a(1) = 2 = prime(1). Then the first occurrence of prime(n) followed by all previous terms. i.e. If the index of first occurrence of prime(n) is k then the next k-1 terms are defined as a(k+r) = a(r), r = 1 to k-1. and a(2k) = prime(n+1) and so on.
%C Index of the first occurrence of prime(n)= 2^(n-1). Subsidiary sequences: If prime(n) is replaced by f(n) a large number of sequences can be obtained choosing f(n) = composite(n), f(n) = n^2,f(n) = n^r, r =3,4,5,..., f(n) = tau(n), f(n) = sigma(n), f(n) = n!, f(n) = Fibonacci(n), f(n) = T(n), triangular number, f(n) = n-th Bell, etc. each giving a distinct fascinating music.
%C The lexicographically earliest sequence such that no product of consecutive terms is a perfect square. - _Joshua Zucker_, Apr 30 2011
%H Antti Karttunen, <a href="/A094290/b094290.txt">Table of n, a(n) for n = 1..16384</a>
%F a(n) = A000040(A001511(n)). - _Omar E. Pol_, Sep 13 2013
%t Array[Prime[IntegerExponent[#, 2] + 1] &, 102] (* _Michael De Vlieger_, Nov 02 2018 *)
%o (PARI) A094290(n) = prime(1+valuation(n,2)); \\ _Antti Karttunen_, Nov 02 2018
%o (Python)
%o from sympy import prime
%o def A094290(n): return prime((~n & n-1).bit_length()+1) # _Chai Wah Wu_, Jul 02 2022
%Y Cf. A000040, A001511.
%Y Cf. also A115364.
%K nonn
%O 1,1
%A _Amarnath Murthy_, Apr 28 2004
%E Replaced the name with a formula given by _Omar E. Pol_, which is equivalent to the original definition. - _Antti Karttunen_, Nov 02 2018
|