login
a(n) is the position of the first occurrence of prime(n) in A027748.
3

%I #30 Nov 27 2020 06:18:06

%S 2,3,5,8,13,16,22,25,32,41,45,55,62,66,73,83,94,98,109,117,120,132,

%T 138,150,166,173,177,185,188,196,224,231,243,247,267,271,284,295,303,

%U 315,327,331,353,356,364,368,394,419,426,430,439,452,456,475,487,500

%N a(n) is the position of the first occurrence of prime(n) in A027748.

%H Alois P. Heinz, <a href="/A308495/b308495.txt">Table of n, a(n) for n = 1..10000</a>

%F A027748(a(n)) = A000040(n).

%F a(n) = 1 + A013939(A000040(n)). - _Charlie Neder_, Jun 04 2019

%F a(n) = A082186(A000040(n)). - _Alois P. Heinz_, Jun 06 2019

%e For n = 5: a(5) = 13, A027748(13) = A000040(5) = 11.

%p b:= proc(n) option remember; `if`(n=1, 1,

%p b(n-1) +nops(ifactors(n)[2]))

%p end:

%p a:= n-> b(ithprime(n)):

%p seq(a(n), n=1..60); # _Alois P. Heinz_, Jun 06 2019

%t b[n_] := b[n] = If[n == 1, 1, b[n-1] + PrimeNu[n]];

%t a[n_] := b[Prime[n]];

%t Array[a, 60] (* _Jean-François Alcover_, Nov 27 2020, after _Alois P. Heinz_ *)

%o (Haskell)

%o -- expected to be part of A027748

%o a027748_list = concat (map a027748_row [1..])

%o minIdx [] _ = []

%o minIdx _ [] = []

%o minIdx (a:as) (b:bs)

%o | a == b = 1 : (map succ (minIdx as bs))

%o | otherwise = map succ (minIdx as (b:bs))

%o a308495_list = minIdx a027748_list a000040_list

%o a308495 n = a308495_list !! (n-1)

%o (PARI) a(n) = 1 + sum(k=1, prime(n), omega(k)); \\ _Michel Marcus_, Jun 05 2019

%Y Cf. A000040, A001221, A013939, A027748, A082186.

%K nonn

%O 1,1

%A _Peter Dolland_, Jun 01 2019