login
This site is supported by donations to The OEIS Foundation.

 

Logo

Thanks to everyone who made a donation during our annual appeal!
To see the list of donors, or make a donation, see the OEIS Foundation home page.

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A078442 a(p) = a(n) + 1 if p is the n-th prime, prime(n); a(n)=0 if n is not prime. 18
0, 1, 2, 0, 3, 0, 1, 0, 0, 0, 4, 0, 1, 0, 0, 0, 2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 3, 0, 1, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,3

COMMENTS

Fernandez calls this the order of primeness of n.

a(A007097(n))=n, for any n >= 0. - Paul Tek, Nov 12 2013

When a nonoriented rooted tree is encoded as a Matula-Goebel number n, a(n) tells how many edges needs to be climbed up from the root of the tree until the first branching vertex (or the top of the tree, if n is one of the terms of A007097) is encountered. Please see illustrations at A061773. - Antti Karttunen, Jan 27 2014

LINKS

Reinhard Zumkeller, Table of n, a(n) for n = 1..10000

N. Fernandez, An order of primeness, F(p)

N. Fernandez, An order of primeness [cached copy, included with permission of the author]

Index entries for sequences related to Matula-Goebel numbers

FORMULA

a(n) = A049076(n)-1.

a(n) = if A049084(n) = 0 then 0 else a(A049084(n)) + 1. - Reinhard Zumkeller, Jul 14 2013

For all n, a(n) = A007814(A135141(n)) and a(A227413(n)) = A007814(n). Also a(A235489(n)) = a(n). - Antti Karttunen, Jan 27 2014

EXAMPLE

a(1) = 0 since 1 is not prime;

a(2) = a(prime(1)) = a(1) + 1 = 1 + 0 = 1;

a(3) = a(prime(2)) = a(2) + 1 = 1 + 1 = 2;

a(4) = 0 since 4 is not prime;

a(5) = a(prime(3)) = a(3) + 1 = 2 + 1 = 3;

a(6) = 0 since 6 is not prime;

a(7) = a(prime(4)) = a(4) + 1 = 0 + 1 = 1.

MAPLE

A078442 := proc(n)

    if not isprime(n) then

        0 ;

    else

        1+procname(numtheory[pi](n)) ;

    end if;

end proc: # R. J. Mathar, Jul 07 2012

MATHEMATICA

a[n_] := a[n] = If[!PrimeQ[n], 0, 1+a[PrimePi[n]]]; Array[a, 105] (* Jean-Fran├žois Alcover, Jan 26 2018 *)

PROG

(PARI) A078442(n)=for(i=0, n, isprime(n) | return(i); n=primepi(n)) \\ M. F. Hasler, Mar 09 2010

(Haskell)

a078442 n = fst $ until ((== 0) . snd)

                        (\(i, p) -> (i + 1, a049084 p)) (-2, a000040 n)

-- Reinhard Zumkeller, Jul 14 2013

CROSSREFS

A left inverse of A007097.

One less than A049076.

a(A000040(n)) = A049076(n).

Cf. A018252 (positions of zeros).

Cf. A049084, A061773.

Cf. permutations A235489, A250247/A250248, A250249/A250250, A245821/A245822 that all preserve a(n).

Cf. also array A114537 (A138947) and permutations A135141/A227413, A246681.

Sequence in context: A322841 A291044 A113290 * A175663 A240672 A243016

Adjacent sequences:  A078439 A078440 A078441 * A078443 A078444 A078445

KEYWORD

nonn

AUTHOR

Henry Bottomley, Dec 31 2002

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified January 19 20:26 EST 2019. Contains 319310 sequences. (Running on oeis4.)