login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo

Please make a donation to keep the OEIS running. We are now in our 56th year. In the past year we added 10000 new sequences and reached almost 9000 citations (which often say "discovered thanks to the OEIS").
Other ways to donate

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A249140 To obtain a(n), write the n-th composite number as a product of primes, subtract 1 from each prime and multiply. 2
1, 2, 1, 4, 4, 2, 6, 8, 1, 4, 4, 12, 10, 2, 16, 12, 8, 6, 8, 1, 20, 16, 24, 4, 18, 24, 4, 12, 10, 16, 22, 2, 36, 16, 32, 12, 8, 40, 6, 36, 28, 8, 30, 24, 1, 48, 20, 16, 44, 24, 4, 36, 32, 18, 60, 24, 4, 16, 40, 12, 64, 42, 56, 10, 16, 72, 22, 60, 46, 72, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

LINKS

Alois P. Heinz, Table of n, a(n) for n = 1..10000

FORMULA

a(n) = A003958(A002808(n)). - Michel Marcus, Oct 22 2014

EXAMPLE

a(1)=1 because the 1st composite number is 4, and the prime factors of 4 are (2,2): (2-1)*(2-1)=1.

a(4)=4 because the 4th composite number is 9, and the prime factors of 9 are (3,3): (3-1)*(3-1)=4.

a(19)=8 because the 19th composite number is 30, and the prime factors of 30 are (2,3,5): (2-1)*(3-1)*(5-1)=8.

MAPLE

b:= proc(n) option remember; local k;

      for k from 1+`if`(n=1, 3, b(n-1))

      while isprime(k) do od; k

    end:

a:= n-> mul((i[1]-1)^i[2], i=ifactors(b(n))[2]):

seq(a(n), n=1..100);  # Alois P. Heinz, Oct 23 2014

MATHEMATICA

b[n_] := Product[{p, e} = pe; (p-1)^e, {pe, FactorInteger[n]}];

b /@ Select[Range[100], CompositeQ] (* Jean-François Alcover, Nov 13 2020 *)

PROG

(PARI) b(n) = my(f=factor(n)); f[, 1] = apply(x->(x-1), f[, 1]); factorback(f); \\ A003958

lista(nn) = apply(b, select(x->((x != 1) && !isprime(x)), [1..nn])); \\ Michel Marcus, Nov 13 2020

CROSSREFS

Cf. A002808, A003958, A114434.

Sequence in context: A086145 A309086 A261070 * A113421 A135366 A247248

Adjacent sequences:  A249137 A249138 A249139 * A249141 A249142 A249143

KEYWORD

nonn,easy

AUTHOR

Gil Broussard, Oct 22 2014

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 November 28 14:27 EST 2020. Contains 338724 sequences. (Running on oeis4.)