cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-10 of 88 results. Next

A098115 a(n) is the length of iteration trajectory when the cototient function (A051953) is applied to the half of the n-th primorial number (A070826(n) = A002110(n)/2).

Original entry on oeis.org

2, 3, 4, 7, 10, 5, 12, 15, 12, 28, 6, 6, 31, 12, 47, 29, 23, 32, 33, 24, 40, 28, 12, 35, 34, 56, 17, 36, 40, 123, 57, 61, 9, 99, 94, 132, 158, 172, 23, 43, 89, 186, 196, 194, 203, 157, 205, 62, 32, 26, 76, 105, 65, 45, 177, 56, 278
Offset: 1

Views

Author

Labos Elemer, Sep 27 2004

Keywords

Comments

Initial values are here odd numbers. Comparing with the case of primorials (A098202), the lengths are here significantly smaller. The cause of this is unknown, albeit informally "understood": lack of powers of 2 in lists because parity is invariant during this iteration. See also lists for A098200 and A098201.

Examples

			For n = 7: list = {255255,163095,77815,16663,895,183,63,27,9,3,1,0}, a(7) = 12, while the comparable length for 510510 is A098202(7) = 43.
		

Crossrefs

Programs

  • Mathematica
    g[x_] :=x-EulerPhi[x]; f[x_] :=Length[FixedPointList[g, x]]-1; q[x_] :=Apply[Times, Table[Prime[j], {j, 1, x}]]; t=Table[f[q[w]/2], {w, 1, 37}]
    a[n_] := Length@ NestWhileList[(# - EulerPhi[#])&, Times @@ Prime[Range[2, n]], # > 0 &]; Array[a, 30] (* Amiram Eldar, Nov 19 2024 *)
  • PARI
    a(n) = {my(p = prod(i=2, n, prime(i)), c = 1); while(p > 0, c++; p -= eulerphi(p)); c;} \\ Amiram Eldar, Nov 19 2024

Formula

a(n) = A053475(A070826(n)) = A053475(A002110(n)/2).

Extensions

a(38)-a(57) from Amiram Eldar, Nov 19 2024

A239738 Triangle read by rows: T(n,k) is the number of n-tuples with sum k + n whose i-th element is a positive integer <= prime(i), 0 <= k < A070826(n).

Original entry on oeis.org

1, 1, 2, 1, 3, 5, 6, 1, 4, 9, 15, 21, 26, 29, 1, 5, 14, 29, 50, 76, 105, 134, 160, 181, 196, 204, 1, 6, 20, 49, 99, 175, 280, 414, 574, 755, 951, 1155, 1359, 1554, 1730, 1876, 1981, 2036, 1, 7, 27, 76, 175, 350, 630, 1044, 1618, 2373, 3324, 4479, 5838, 7392, 9122, 10998, 12979, 15014, 17044, 19005, 20832, 22463, 23842, 24921, 25662, 26039
Offset: 1

Views

Author

Stuart Cooper, Mar 26 2014

Keywords

Comments

Original name: Normal distributions from the primes. The contracted sequence of integers generated from the frequencies of the summation of elements of the subsets of the Cartesian product of the natural numbers of ascending prime cardinality. That is, given a number of sets of the natural numbers of ascending modulo P(n+1), the probabilities of generating a given number from the selection of one element from each set form the given sequence.
Although this sequence initially appears similar to A131791, its derivation is entirely different and it deviates quickly.
By sets of natural numbers of ascending prime cardinality, it is meant
N_1 = {1,2}, N_2 = {1,2,3}, N_3 = {1,2,3,4,5}, N_4 = {1,2,3,4,5,6,7}, ..., N_w = {1,2,3,...,p_w}, where the p_i are primes.
with Cartesian products
N_1 X N_2 = {1,2} X {1,2,3} = {(1,1),(1,2),(1,3),(2,1),(2,2),(2,3)}, etc.
and the sum of the elements of the product's subsets denoted
Sum[N_1 X N_2] = {(2),(3),(4),(3),(4),(5)}
whose elements have the frequencies [1,2,2,1] (with respect to magnitude). It is these frequencies that form the sequence, the symmetry allows for the omission of repeated terms, and hence the following contraction halves the data without loss of information:
[1,1] -> [1]
[1,2,2,1] -> [1,2]
[1,3,5,6,6,5,3,1] -> [1,3,5,6]
and so forth.
When arranged by row of the number of sets used, then P(S(u,r) = u + r - 1) = T(r,u)/prime(r)#, P(S = X) the probability that the sum S equals the value X, and prime(r)# is the product of the first r primes (A002110), then the structure and symmetry become more apparent.
Each row contains l(r) = (1/2)*(Sum p(r) - r + 1) terms and clearly the sum of each row must equal half the product of the primes used,
Sum_{u=1..l(r)} T(r,u) = (1/2)*prime(r)#,
and one can see that in general for all u, r:
P(S(u,r) = r) = P(S(u,r) = Sum p(r)) = 1/Product p(r),
P(S(u,r) = r + 1) = P(S(u,r) = Sum p(r) - 1) = r/prime(r)#,
P(S = r + i) = P(S = Sum p(r) - i) = T(r,u+i)/prime(r)#, [0 <= i <= l(r) - 1)],
S(u,r) ~ N(mu(r),sigma(r)^2).

Examples

			Triangle T(n,k) begins: (n >= 1, k >= 0)
  1;
  1, 2;
  1, 3,  5,  6;
  1, 4,  9, 15, 21,  26,  29;
  1, 5, 14, 29, 50,  76, 105, 134, 160, 181, 196,  204;
  1, 6, 20, 49, 99, 175, 280, 414, 574, 755, 951, 1155, 1359, 1554, 1730, 1876, 1981, 2036;
  ...
T(3, 2) = 5 because the following 3-tuples have sum 2 + 3 = 5: (1,1,3), (1,2,2), (1,3,1), (2,1,2), (2,2,1). The tuple (3,1,1) is excluded because the 1st term is required to be no greater than prime(1) = 2.
		

Crossrefs

Row sums are A070826.
Cf. A005521 (row lengths).

Programs

  • Mathematica
    row[r_]:=Drop[#,-Length[#]/2]&[Transpose[Tally[Total[Tuples[Table[Range[1,Prime[k]],{k,1,r}]],{2}]]][[2]]] (* generates row r of the table *)
    Grid@Table[row[r],{r,1,7}] (* generates the table *)
    Flatten@Table[row[r],{r,1,7}] (* generates the sequence *) (* Steven Foster Clark, Feb 02 2023 *)
    row[r_]:=Drop[#,-Length[#]/2]&[CoefficientList[1/(x-1)^r Product[(x^Prime[i]-1),{i,1,r}],x]] (* generates row r of the table *) (* Steven Foster Clark, Feb 07 2023 *)
  • PARI
    row(n)={my(v=Vecrev(prod(i=1, n, 1 - x^prime(i))/(1 - x)^n)); v[1..#v/2]} \\ Andrew Howroyd, Feb 06 2023

Formula

T(n,k) = [x^k] (1/(x-1)^n) * Product_{i=1..n} (x^prime(i)-1). - Steven Foster Clark, Feb 05 2023
T(n,k) = [x^k] Product_{i=1..n} Sum_{j=0..prime(i)-1} x^j. - Andrew Howroyd, Feb 05 2023

Extensions

Name edited by Andrew Howroyd, Feb 05 2023

A330349 a(n) = A070826(n+1) - 2^(n-1).

Original entry on oeis.org

2, 13, 101, 1147, 14999, 255223, 4849781, 111546307, 3234846359, 100280244553, 3710369066381, 152125131761557, 6541380665830919, 307444891294237513, 16294579238595005981, 961380175077106286767
Offset: 1

Views

Author

Ahmad J. Masad, Dec 11 2019

Keywords

Comments

Conjecture: For each value of n, the power of each prime number in the prime factorization of a(n) is equal to 1.

Examples

			a(4) = 1147 = 31*37.
a(10) = A070826(11) - 2^9 = 100280245065 - 512 = 100280244553 = A000040(4129119109).
		

Crossrefs

Programs

  • PARI
    a(n) = prod(k=1, n+1, prime(k))/2  - 2^(n-1); \\ Michel Marcus, Dec 11 2019
    
  • Python
    from sympy import primorial
    def A330349(n): return (primorial(n+1)>>1)-(1<Chai Wah Wu, Jul 21 2022

A095991 Numbers m such that f(k) * 2^m - 1 is prime, where f(j) = A070826(j) and k is the number of decimal digits of 2^m.

Original entry on oeis.org

2, 3, 4, 6, 14, 17, 18, 23, 33, 43, 45, 53, 60, 70, 114, 141, 162, 178, 387, 657, 787, 951, 1517, 1882, 1999, 2423, 2722, 3635, 3636, 3893, 5021, 5631, 7580, 7674, 8318, 9479, 19761
Offset: 1

Views

Author

Jason Earls, Jul 18 2004

Keywords

Comments

a(1) through a(32) have been proved to be prime with WinPFGW. a(32) has 7901 digits. No more terms up to 7300.
Results were computed using the PrimeFormGW (PFGW) primality-testing program. - Hugo Pfoertner, Nov 14 2019

Examples

			a(5)=14 because 1155 * 2^14 - 1 = 18923519, a prime.
		

Programs

  • Mathematica
    Do[ If[ PrimeQ[ Product[ Prime[i], {i, Floor[ n / Log[2, 10] + 1]}] * 2^(n - 1) - 1], Print[n]], {n, 7300}] (* Robert G. Wilson v, Jul 23 2004 *)

Extensions

Edited by Robert G. Wilson v, Jul 23 2004
a(33)-a(37) from Michael S. Branicky, Aug 03 2024

A337022 a(n) is the number of positive integers <= A070826(n) with at least one odd prime divisor <= prime(n).

Original entry on oeis.org

0, 1, 7, 57, 675, 9255, 163095, 3190965, 75051075, 2212976535, 69624142665, 2606749381005, 107980344307605, 4687299592683015, 222157161929253705, 11859617311615438365, 704152383312290447535, 43210523173814533171635, 2910538720151462674819545, 207666871186142520765307695
Offset: 1

Views

Author

Zhandos Mambetaliyev, Aug 11 2020

Keywords

Comments

The set of finite differences positive numbers up to A070826(n) with at least one odd prime divisor <= prime(n) is a palindromic set.

Examples

			a(3) = 7, p = {3, 5}, prime(n)# / 2 = 15, {3, 5, 6, 9, 10, 12, 15} - divisible by 3 or 5.
		

Crossrefs

Programs

  • PARI
    pm=1; forprime(p=2,19,pm*=p; my(k=0); for(x=2,pm/2, forprime(q=3,p, if(x%q==0,k++;break))); print1(k,", ")) \\ Hugo Pfoertner, Aug 11 2020

Formula

a(n+1) = (prime(n+1) - 1)*a(n) + A070826(n). - Jinyuan Wang, Aug 11 2020
a(n) = A002110(n)/2 - A005867(n). - Jamie Morken, Aug 11 2021

Extensions

a(8)-a(10) from Hugo Pfoertner, Aug 11 2020
More terms from Jinyuan Wang, Aug 11 2020

A005940 The Doudna sequence: write n-1 in binary; power of prime(k) in a(n) is # of 1's that are followed by k-1 0's.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 9, 8, 7, 10, 15, 12, 25, 18, 27, 16, 11, 14, 21, 20, 35, 30, 45, 24, 49, 50, 75, 36, 125, 54, 81, 32, 13, 22, 33, 28, 55, 42, 63, 40, 77, 70, 105, 60, 175, 90, 135, 48, 121, 98, 147, 100, 245, 150, 225, 72, 343, 250, 375, 108, 625, 162, 243, 64, 17, 26, 39
Offset: 1

Views

Author

Keywords

Comments

A permutation of the natural numbers. - Robert G. Wilson v, Feb 22 2005
Fixed points: A029747. - Reinhard Zumkeller, Aug 23 2006
The even bisection, when halved, gives the sequence back. - Antti Karttunen, Jun 28 2014
From Antti Karttunen, Dec 21 2014: (Start)
This irregular table can be represented as a binary tree. Each child to the left is obtained by applying A003961 to the parent, and each child to the right is obtained by doubling the parent:
1
|
...................2...................
3 4
5......../ \........6 9......../ \........8
/ \ / \ / \ / \
/ \ / \ / \ / \
/ \ / \ / \ / \
7 10 15 12 25 18 27 16
11 14 21 20 35 30 45 24 49 50 75 36 125 54 81 32
etc.
Sequence A163511 is obtained by scanning the same tree level by level, from right to left. Also in binary trees A253563 and A253565 the terms on level of the tree are some permutation of the terms present on the level n of this tree. A252464(n) gives the distance of n from 1 in all these trees.
A252737(n) gives the sum and A252738(n) the product of terms on row n (where 1 is on row 0, 2 on row 1, 3 and 4 on row 2, etc.). A252745(n) gives the number of nodes on level n whose left child is larger than the right child, A252750 the difference between left and right child for each node from node 2 onward.
(End)
-A008836(a(1+n)) gives the corresponding numerator for A323505(n). - Antti Karttunen, Jan 19 2019
(a(2n+1)-1)/2 [= A244154(n)-1, for n >= 0] is a permutation of the natural numbers. - George Beck and Antti Karttunen, Dec 08 2019
From Peter Munn, Oct 04 2020: (Start)
Each term has the same even part (equivalently, the same 2-adic valuation) as its index.
Using the tree depicted in Antti Karttunen's 2014 comment:
Numbers are on the right branch (4 and descendants) if and only if divisible by the square of their largest prime factor (cf. A070003).
Numbers on the left branch, together with 2, are listed in A102750.
(End)
According to Kutz (1981), he learned of this sequence from American mathematician Byron Leon McAllister (1929-2017) who attributed the invention of the sequence to a graduate student by the name of Doudna (first name Paul?) in the mid-1950's at the University of Wisconsin. - Amiram Eldar, Jun 17 2021
From David James Sycamore, Sep 23 2022: (Start)
Alternative (recursive) definition: If n is a power of 2 then a(n)=n. Otherwise, if 2^j is the greatest power of 2 not exceeding n, and if k = n - 2^j, then a(n) is the least m*a(k) that has not occurred previously, where m is an odd prime.
Example: Use recursion with n = 77 = 2^6 + 13. a(13) = 25 and since 11 is the smallest odd prime m such that m*a(13) has not already occurred (see a(27), a(29),a(45)), then a(77) = 11*25 = 275. (End)
The odd bisection, when transformed by replacing all prime(k)^e in a(2*n - 1) with prime(k-1)^e, returns a(n), and thus gives the sequence back. - David James Sycamore, Sep 28 2022

Examples

			From _N. J. A. Sloane_, Aug 22 2022: (Start)
Let c_i = number of 1's in binary expansion of n-1 that have i 0's to their right, and let p(j) = j-th prime.  Then a(n) = Product_i p(i+1)^c_i.
If n=9, n-1 is 1000, c_3 = 1, a(9) = p(4)^1 = 7.
If n=10, n-1 = 1001, c_0 = 1, c_2 = 1, a(10) = p(1)*p(3) = 2*5 = 10.
If n=11, n-1 = 1010, c_1 = 1, c_2 = 1, a(11) = p(2)*p(3) = 15. (End)
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A103969. Inverse is A005941 (A156552).
Cf. A125106. [From Franklin T. Adams-Watters, Mar 06 2010]
Cf. A252737 (gives row sums), A252738 (row products), A332979 (largest on row).
Related permutations of positive integers: A163511 (via A054429), A243353 (via A006068), A244154, A253563 (via A122111), A253565, A332977, A334866 (via A225546).
A000120, A003602, A003961, A006519, A053645, A070939, A246278, A250246, A252753, A253552 are used in a formula defining this sequence.
Formulas for f(a(n)) are given for f = A000265, A003963, A007949, A055396, A056239.
Numbers that occur at notable sets of positions in the binary tree representation of the sequence: A000040, A000079, A002110, A070003, A070826, A102750.
Cf. A106737, A290077, A323915, A324052, A324054, A324055, A324056, A324057, A324058, A324114, A324335, A324340, A324348, A324349 for various number-theoretical sequences applied to (i.e., permuted by) this sequence.
k-adic valuation: A007814 (k=2), A337821 (k=3).
Positions of multiples of 3: A091067.
Primorial deflation: A337376 / A337377.
Sum of prime indices of a(n) is A161511, reverse version A359043.
A048793 lists binary indices, ranked by A019565.
A066099 lists standard comps, partial sums A358134 (ranked by A358170).

Programs

  • Haskell
    a005940 n = f (n - 1) 1 1 where
       f 0 y _          = y
       f x y i | m == 0 = f x' y (i + 1)
               | m == 1 = f x' (y * a000040 i) i
               where (x',m) = divMod x 2
    -- Reinhard Zumkeller, Oct 03 2012
    (Scheme, with memoization-macro definec from Antti Karttunen's IntSeq-library)
    (define (A005940 n) (A005940off0 (- n 1))) ;; The off=1 version, utilizing any one of three different offset-0 implementations:
    (definec (A005940off0 n) (cond ((< n 2) (+ 1 n)) (else (* (A000040 (- (A070939 n) (- (A000120 n) 1))) (A005940off0 (A053645 n))))))
    (definec (A005940off0 n) (cond ((<= n 2) (+ 1 n)) ((even? n) (A003961 (A005940off0 (/ n 2)))) (else (* 2 (A005940off0 (/ (- n 1) 2))))))
    (define (A005940off0 n) (let loop ((n n) (i 1) (x 1)) (cond ((zero? n) x) ((even? n) (loop (/ n 2) (+ i 1) x)) (else (loop (/ (- n 1) 2) i (* x (A000040 i)))))))
    ;; Antti Karttunen, Jun 26 2014
    
  • Maple
    f := proc(n,i,x) option remember ; if n = 0 then x; elif type(n,'even') then procname(n/2,i+1,x) ; else procname((n-1)/2,i,x*ithprime(i)) ; end if; end proc:
    A005940 := proc(n) f(n-1,1,1) ; end proc: # R. J. Mathar, Mar 06 2010
  • Mathematica
    f[n_] := Block[{p = Partition[ Split[ Join[ IntegerDigits[n - 1, 2], {2}]], 2]}, Times @@ Flatten[ Table[q = Take[p, -i]; Prime[ Count[ Flatten[q], 0] + 1]^q[[1, 1]], {i, Length[p]}] ]]; Table[ f[n], {n, 67}] (* Robert G. Wilson v, Feb 22 2005 *)
    Table[Times@@Prime/@(Join@@Position[Reverse[IntegerDigits[n,2]],1]-Range[DigitCount[n,2,1]]+1),{n,0,100}] (* Gus Wiseman, Dec 28 2022 *)
  • PARI
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, n%2 && (t*=p) || p=nextprime(p+1)); t } \\ M. F. Hasler, Mar 07 2010; update Aug 29 2014
    
  • PARI
    a(n)=my(p=2, t=1); for(i=0,exponent(n), if(bittest(n,i), t*=p, p=nextprime(p+1))); t \\ Charles R Greathouse IV, Nov 11 2021
    
  • Python
    from sympy import prime
    import math
    def A(n): return n - 2**int(math.floor(math.log(n, 2)))
    def b(n): return n + 1 if n<2 else prime(1 + (len(bin(n)[2:]) - bin(n)[2:].count("1"))) * b(A(n))
    print([b(n - 1) for n in range(1, 101)]) # Indranil Ghosh, Apr 10 2017
    
  • Python
    from math import prod
    from itertools import accumulate
    from collections import Counter
    from sympy import prime
    def A005940(n): return prod(prime(len(a)+1)**b for a, b in Counter(accumulate(bin(n-1)[2:].split('1')[:0:-1])).items()) # Chai Wah Wu, Mar 10 2023

Formula

From Reinhard Zumkeller, Aug 23 2006, R. J. Mathar, Mar 06 2010: (Start)
a(n) = f(n-1, 1, 1)
where f(n, i, x) = x if n = 0,
= f(n/2, i+1, x) if n > 0 is even
= f((n-1)/2, i, x*prime(i)) otherwise. (End)
From Antti Karttunen, Jun 26 2014: (Start)
Define a starting-offset 0 version of this sequence as:
b(0)=1, b(1)=2, [base cases]
and then compute the rest either with recurrence:
b(n) = A000040(1+(A070939(n)-A000120(n))) * b(A053645(n)).
or
b(2n) = A003961(b(n)), b(2n+1) = 2 * b(n). [Compare this to the similar recurrence given for A163511.]
Then define a(n) = b(n-1), where a(n) gives this sequence A005940 with the starting offset 1.
Can be also defined as a composition of related permutations:
a(n+1) = A243353(A006068(n)).
a(n+1) = A163511(A054429(n)). [Compare the scatter plots of this sequence and A163511 to each other.]
This permutation also maps between the partitions as enumerated in the lists A125106 and A112798, providing identities between:
A161511(n) = A056239(a(n+1)). [The corresponding sums ...]
A243499(n) = A003963(a(n+1)). [... and the products of parts of those partitions.]
(End)
From Antti Karttunen, Dec 21 2014 - Jan 04 2015: (Start)
A002110(n) = a(1+A002450(n)). [Primorials occur at (4^n - 1)/3 in the offset-0 version of the sequence.]
a(n) = A250246(A252753(n-1)).
a(n) = A122111(A253563(n-1)).
For n >= 1, A055396(a(n+1)) = A001511(n).
For n >= 2, a(n) = A246278(1+A253552(n)).
(End)
From Peter Munn, Oct 04 2020: (Start)
A000265(a(n)) = a(A000265(n)) = A003961(a(A003602(n))).
A006519(a(n)) = a(A006519(n)) = A006519(n).
a(n) = A003961(a(A003602(n))) * A006519(n).
A007814(a(n)) = A007814(n).
A007949(a(n)) = A337821(n) = A007814(A003602(n)).
a(n) = A225546(A334866(n-1)).
(End)
a(2n) = 2*a(n), or generally a(2^k*n) = 2^k*a(n). - Amiram Eldar, Oct 03 2022
If n-1 = Sum_{i} 2^(q_i-1), then a(n) = Product_{i} prime(q_i-i+1). These are the Heinz numbers of the rows of A125106. If the offset is changed to 0, the inverse is A156552. - Gus Wiseman, Dec 28 2022

Extensions

More terms from Robert G. Wilson v, Feb 22 2005
Sign in a formula switched and Maple program added by R. J. Mathar, Mar 06 2010
Binary tree illustration and keyword tabf added by Antti Karttunen, Dec 21 2014

A260443 Prime factorization representation of Stern polynomials: a(0) = 1, a(1) = 2, a(2n) = A003961(a(n)), a(2n+1) = a(n)*a(n+1).

Original entry on oeis.org

1, 2, 3, 6, 5, 18, 15, 30, 7, 90, 75, 270, 35, 450, 105, 210, 11, 630, 525, 6750, 245, 20250, 2625, 9450, 77, 15750, 3675, 47250, 385, 22050, 1155, 2310, 13, 6930, 5775, 330750, 2695, 3543750, 128625, 1653750, 847, 4961250, 643125, 53156250, 18865, 24806250, 202125, 727650, 143, 1212750, 282975, 57881250, 29645, 173643750, 1414875, 18191250, 1001
Offset: 0

Views

Author

Antti Karttunen, Jul 28 2015

Keywords

Comments

The exponents in the prime factorization of term a(n) give the coefficients of the n-th Stern polynomial. See A125184 and the examples.
None of the terms have prime gaps in their factorization, i.e., all can be found in A073491.
Contains neither perfect squares nor prime powers with exponent > 1. A277701 gives the positions of the terms that are 2*square. - Antti Karttunen, Oct 27 2016
Many of the derived sequences (like A002487) have similar "Fir forest" or "Gaudian cathedrals" style scatter plot. - Antti Karttunen, Mar 21 2017

Examples

			n    a(n)   prime factorization    Stern polynomial
------------------------------------------------------------
0       1   (empty)                B_0(x) = 0
1       2   p_1                    B_1(x) = 1
2       3   p_2                    B_2(x) = x
3       6   p_2 * p_1              B_3(x) = x + 1
4       5   p_3                    B_4(x) = x^2
5      18   p_2^2 * p_1            B_5(x) = 2x + 1
6      15   p_3 * p_2              B_6(x) = x^2 + x
7      30   p_3 * p_2 * p_1        B_7(x) = x^2 + x + 1
8       7   p_4                    B_8(x) = x^3
9      90   p_3 * p_2^2 * p_1      B_9(x) = x^2 + 2x + 1
		

Crossrefs

Same sequence sorted into ascending order: A260442.
Cf. also A048675, A277333 (left inverses).
Cf. A277323, A277324 (bisections), A277200 (even terms sorted), A277197 (first differences), A277198.
Cf. A277316 (values at primes), A277318.
Cf. A023758 (positions of squarefree terms), A101082 (of terms not squarefree), A277702 (positions of records), A277703 (their values).
Cf. A283992, A283993 (number of irreducible, reducible polynomials in range 1 .. n).
Cf. also A206296 (Fibonacci polynomials similarly represented).

Programs

  • Maple
    b:= n-> mul(nextprime(i[1])^i[2], i=ifactors(n)[2]):
    a:= proc(n) option remember; `if`(n<2, n+1,
          `if`(irem(n, 2, 'h')=0, b(a(h)), a(h)*a(n-h)))
        end:
    seq(a(n), n=0..56);  # Alois P. Heinz, Jul 04 2024
  • Mathematica
    a[n_] := a[n] = Which[n < 2, n + 1, EvenQ@ n, Times @@ Map[#1^#2 & @@ # &, FactorInteger[#] /. {p_, e_} /; e > 0 :> {Prime[PrimePi@ p + 1], e}] - Boole[# == 1] &@ a[n/2], True, a[#] a[# + 1] &[(n - 1)/2]]; Table[a@ n, {n, 0, 56}] (* Michael De Vlieger, Apr 05 2017 *)
  • PARI
    A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ From Michel Marcus
    A260443(n) = if(n<2, n+1, if(n%2, A260443(n\2)*A260443(n\2+1), A003961(A260443(n\2)))); \\ After Charles R Greathouse IV's code for "ps" in A186891.
    \\ Antti Karttunen, Oct 11 2016
    
  • Python
    from sympy import factorint, prime, primepi
    from functools import reduce
    from operator import mul
    def a003961(n):
        F = factorint(n)
        return 1 if n==1 else reduce(mul, (prime(primepi(i) + 1)**F[i] for i in F))
    def a(n): return n + 1 if n<2 else a003961(a(n//2)) if n%2==0 else a((n - 1)//2)*a((n + 1)//2)
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 21 2017
  • Scheme
    ;; Uses memoization-macro definec:
    (definec (A260443 n) (cond ((<= n 1) (+ 1 n)) ((even? n) (A003961 (A260443 (/ n 2)))) (else (* (A260443 (/ (- n 1) 2)) (A260443 (/ (+ n 1) 2))))))
    ;; A more standalone version added Oct 10 2016, requiring only an implementation of A000040 and the memoization-macro definec:
    (define (A260443 n) (product_primes_to_kth_powers (A260443as_coeff_list n)))
    (define (product_primes_to_kth_powers nums) (let loop ((p 1) (nums nums) (i 1)) (cond ((null? nums) p) (else (loop (* p (expt (A000040 i) (car nums))) (cdr nums) (+ 1 i))))))
    (definec (A260443as_coeff_list n) (cond ((zero? n) (list)) ((= 1 n) (list 1)) ((even? n) (cons 0 (A260443as_coeff_list (/ n 2)))) (else (add_two_lists (A260443as_coeff_list (/ (- n 1) 2)) (A260443as_coeff_list (/ (+ n 1) 2))))))
    (define (add_two_lists nums1 nums2) (let ((len1 (length nums1)) (len2 (length nums2))) (cond ((< len1 len2) (add_two_lists nums2 nums1)) (else (map + nums1 (append nums2 (make-list (- len1 len2) 0)))))))
    

Formula

a(0) = 1, a(1) = 2, a(2n) = A003961(a(n)), a(2n+1) = a(n)*a(n+1).
Other identities. For all n >= 0:
A001221(a(n)) = A277314(n). [#nonzero coefficients in each polynomial.]
A001222(a(n)) = A002487(n). [When each polynomial is evaluated at x=1.]
A048675(a(n)) = n. [at x=2.]
A090880(a(n)) = A178590(n). [at x=3.]
A248663(a(n)) = A264977(n). [at x=2 over the field GF(2).]
A276075(a(n)) = A276081(n). ["at factorials".]
A156552(a(n)) = A277020(n). [Converted to "unary-binary" encoding.]
A051903(a(n)) = A277315(n). [Maximal coefficient.]
A277322(a(n)) = A277013(n). [Number of irreducible polynomial factors.]
A005361(a(n)) = A277325(n). [Product of nonzero coefficients.]
A072411(a(n)) = A277326(n). [And their LCM.]
A007913(a(n)) = A277330(n). [The squarefree part.]
A000005(a(n)) = A277705(n). [Number of divisors.]
A046523(a(n)) = A278243(n). [Filter-sequence.]
A284010(a(n)) = A284011(n). [True for n > 1. Another filter-sequence.]
A003415(a(n)) = A278544(n). [Arithmetic derivative.]
A056239(a(n)) = A278530(n). [Weighted sum of coefficients.]
A097249(a(n)) = A277899(n).
a(A000079(n)) = A000040(n+1).
a(A000225(n)) = A002110(n).
a(A000051(n)) = 3*A002110(n).
For n >= 1, a(A000918(n)) = A070826(n).
A007949(a(n)) is the interleaving of A000035 and A005811, probably A101979.
A061395(a(n)) = A277329(n).
Also, for all n >= 1:
A055396(a(n)) = A001511(n).
A252735(a(n)) = A061395(a(n)) - 1 = A057526(n).
a(A000040(n)) = A277316(n).
a(A186891(1+n)) = A277318(n). [Subsequence for irreducible polynomials].

Extensions

More linking formulas added by Antti Karttunen, Mar 21 2017

A024451 a(n) is the numerator of Sum_{i = 1..n} 1/prime(i).

Original entry on oeis.org

0, 1, 5, 31, 247, 2927, 40361, 716167, 14117683, 334406399, 9920878441, 314016924901, 11819186711467, 492007393304957, 21460568175640361, 1021729465586766997, 54766551458687142251, 3263815694539731437539, 201015517717077830328949, 13585328068403621603022853
Offset: 0

Views

Author

Keywords

Comments

Arithmetic derivative of p#: a(n) = A003415(A002110(n)). - Reinhard Zumkeller, Feb 25 2002
(n-1)-st elementary symmetric functions of first n primes; see Mathematica section. - Clark Kimberling, Dec 29 2011
Denominators of the harmonic mean of the first n primes; A250130 gives the numerators. - Colin Barker, Nov 14 2014
Let Pn(n) = A002110 denote the primorial function. The average number of distinct prime factors <= prime(n) in the natural numbers up to Pn(n) is equal to Sum_{i = 1..n} 1/prime(i). - Jamie Morken, Sep 17 2018
Conjecture: All terms are squarefree numbers. - Nicolas Bělohoubek, Apr 13 2022
The above conjecture would imply that for n > 0, gcd(a(n), A369651(n)) = 1. See corollary 2 on the page 4 of Ufnarovski-Åhlander paper. - Antti Karttunen, Jan 31 2024
Apart from the initial 0, a subsequence of A048103. Proof: For all primes p, when i >= A000720(p), neither p itself nor p^p divides a(i) [implied by Henry Bottomley's Sep 27 2006 formula], but neither does p^p divide a(i) when 0 < i < A000720(p), as then p^p > a(i). See A074107, which gives an upper bound for this sequence. - Antti Karttunen, Nov 19 2024

Examples

			0/1, 1/2, 5/6, 31/30, 247/210, 2927/2310, 40361/30030, 716167/510510, 14117683/9699690, ...
		

References

  • S. R. Finch, Mathematical Constants, Cambridge, 2003, Sect. 2.2.
  • D. S. Mitrinovic et al., Handbook of Number Theory, Kluwer, Sect. VII.28.

Crossrefs

Denominators are A002110.
Row sums of A077011 and A258566.
Subsequence of A048103 (after the initial 0).
Cf. A053144 (a lower bound), A074107 (an upper bound).
Cf. A109628 (indices k where a(k) is prime), A244622 (corresponding primes), A244621 (a(n) mod 12).
Cf. A369972 (k where prime(1+k)|a(k)), A369973 (corresponding primorials), A293457 (corresponding primes), A377992 (antiderivatives of the terms > 1 of this sequence).

Programs

  • Magma
    [ Numerator(&+[ NthPrime(k)^-1: k in [1..n]]): n in [1..18] ];  // Bruno Berselli, Apr 11 2011
    
  • Maple
    h:= n-> add(1/(ithprime(i)),i=1..n);
    t1:=[seq(h(n),n=0..50)];
    t1a:=map(numer,t1); # A024451
    t1b:=map(denom,t1); # A002110 - N. J. A. Sloane, Apr 25 2014
  • Mathematica
    a[n_] := Numerator @ Sum[1/Prime[i], {i, n}]; Array[a,18]  (* Jean-François Alcover, Apr 11 2011 *)
    f[k_] := Prime[k]; t[n_] := Table[f[k], {k, 1, n}]
    a[n_] := SymmetricPolynomial[n - 1, t[n]]
    Table[a[n], {n, 1, 16}] (* A024451 *)
    (* Clark Kimberling, Dec 29 2011 *)
    Numerator[Accumulate[1/Prime[Range[20]]]] (* Harvey P. Dale, Apr 11 2012 *)
  • PARI
    a(n) = numerator(sum(i=1, n, 1/prime(i))); \\ Michel Marcus, Sep 18 2018
    
  • Python
    from sympy import prime
    from fractions import Fraction
    def a(n): return sum(Fraction(1, prime(k)) for k in range(1, n+1)).numerator
    print([a(n) for n in range(20)]) # Michael S. Branicky, Feb 12 2021
    
  • Python
    from math import prod
    from sympy import prime
    def A024451(n):
        q = prod(plist:=tuple(prime(i) for i in range(1,n+1)))
        return sum(q//p for p in plist) # Chai Wah Wu, Nov 03 2022

Formula

Limit_{n->oo} (Sum_{p <= n} 1/p - log log n) = 0.2614972... = A077761.
a(n) = (Product_{i=1..n} prime(i))*(Sum_{i=1..n} 1/prime(i)). - Benoit Cloitre, Jan 30 2002
(n+1)-st elementary symmetric function of the first n primes.
a(n) = a(n-1)*A000040(n) + A002110(n-1). - Henry Bottomley, Sep 27 2006
From Antti Karttunen, Jan 31 2024, Feb 08 2024 and Nov 19 2024: (Start)
a(0) = 0, for n > 0, a(n) = 2*A203008(n-1) + A070826(n).
For n > 0, a(n) = A327860(A143293(n-1)).
For n > 0, a(n) = A348301(n) + A002110(n).
For n = 3..175, a(n) = A356253(A002110(n)). [See comments in A356253.]
For n >= 0, A053144(n) <= a(n) <= A074107(n) < A070826(1+n).
(End)

Extensions

a(0)=0 prepended by Alois P. Heinz, Jun 26 2015

A038547 Least number with exactly n odd divisors.

Original entry on oeis.org

1, 3, 9, 15, 81, 45, 729, 105, 225, 405, 59049, 315, 531441, 3645, 2025, 945, 43046721, 1575, 387420489, 2835, 18225, 295245, 31381059609, 3465, 50625, 2657205, 11025, 25515, 22876792454961, 14175, 205891132094649, 10395, 1476225, 215233605
Offset: 1

Views

Author

Keywords

Comments

Also least odd number with exactly n divisors. - Lekraj Beedassy, Aug 30 2006
a(2n-1) = {1, 9, 81, 729, 225, 59049, ...} are the squares. A122842(n) = sqrt(a(2n-1)) = {1, 3, 9, 27, 15, 243, 729, 45, 6561, 19683, 135, 177147, 225, 105, 4782969, 14348907, 1215, ...}. - Alexander Adamchuk, Sep 13 2006
Also the least number k such that there are n partitions of k whose elements are consecutive integers. I.e., 1=1, 3=1+2=3, 9=2+3+4=4+5=9, 15=1+2+3+4+5=4+5+6=7+8=15, etc. - Robert G. Wilson v, Jun 02 2007
The politeness of an integer, A069283(n), is defined to be the number of its nontrivial runsum representations, and the sequence 3, 9, 15, 81, 45, 729, 105, ... represents the least integers to have a politeness of 1, 2, 3, 4, ... This is also the sequence of smallest integers with n+1 odd divisors and so apart from the leading 1, is precisely this sequence. - Ant King, Sep 23 2009
a(n) is also the least number k with the property that the symmetric representation of sigma(k) has n subparts. - Omar E. Pol, Dec 31 2016

Examples

			a(2^3) = 105 = 3*5 while a(2^4) = 945 = 3^3 * 5 * 7. There are 5 partition lists for the exponents of numbers with 16 odd divisors; they are {1, 1, 1, 1}, {3, 1, 1}, {3, 3}, {7, 1}, and {15} that result in the 5 numbers 1155, 945, 3375, 10935, and 14348907. Number a(3^8) = a(6561) = 3^2 * 5^2 * ... * 19^2 * 23^2 = 12442607161209225 while a(3^9) = a(19683) = 3^8 * 5^2 * ... * 19^2 * 23^2 = 9070660620521525025. The numbers a(5^52) = 3^4 * 5^4 * 7^4 * ... and a(5^53) = 3^24 * 5^4 * 7^4 * ... have 393 and 402 digits, respectively.  - _Hartmut F. W. Hoft_, Nov 03 2022
		

Crossrefs

A122842 = sqrt( a(2n-1) ).
Row 1 of A266531. - Omar E. Pol, Dec 31 2016

Programs

  • Haskell
    import Data.List  (find)
    import Data.Maybe (fromJust)
    a038547 n = fromJust $ find ((== n) . length . divisors) [1,3..]
       where divisors m = filter ((== 0) . mod m) [1..m]
    -- Reinhard Zumkeller, Feb 24 2011
    
  • Mathematica
    Table[Select[Range[1,532000,2],DivisorSigma[0,#]==k+1 &,1],{k,0,15}]//Flatten (* Ant King, Nov 28 2010 *)
    2#-1&/@With[{ds=DivisorSigma[0,Range[1,600000,2]]},Table[Position[ds,n,1,1],{n,16}]]//Flatten (* The program is not suitable for generating terms beyond a(16) *) (* Harvey P. Dale, Jun 06 2017 *)
    (* direct computation of A038547(n) *)
    (* Function by _Vaclav Kotesovec_in A005179, Apr 04 2021, modified for odd divisors *)
    mp[1, m_] := {{}}; mp[n_, 1] := {{}}; mp[n_?PrimeQ, m_] := If[mHartmut F. W. Hoft, Mar 05 2023 *)
  • PARI
    for(nd=1,15,forstep(k=1,10^66,2,if(nd==numdiv(k),print1(k,", ");break())))
    
  • Python
    from math import prod
    from sympy import isprime, divisors, prime
    def A038547(n):
        def mult_factors(n):
            if isprime(n):
                return [(n,)]
            c = []
            for d in divisors(n,generator=True):
                if 1Chai Wah Wu, Aug 17 2024

Formula

a(p) = 3^(p-1) for primes p. - Zak Seidov, Apr 18 2006
a(n) = A119265(n,n). - Reinhard Zumkeller, May 11 2006
It was suggested by Alexander Adamchuk that for all n >= 1, we have a(3^(n-1)) = (p(n)#/2)^2 = (A002110(n)/2)^2 = A070826(n)^2. But this is false! E.g., (p(n)#/2)^2 = 3^2 * 5^2 * 7^2 * ... * 23^2 * 29^2 does indeed have 3^9 odd factors, but it is greater than 3^8 * 5^2 * 7^2 * ... * 23^2 which has 9*3*3*3*3*3*3*3 = 9*3^7 = 3^9 odd factors. - Richard Sabey, Oct 06 2007
a(A053640(m)) = a(A000005(A053624(m))) = A053624(m). - Rick L. Shepherd, Apr 20 2008
a(p^k) = Product_{i=1..k} prime(i+1)^(p-1), p prime and k >= 0, only when p_(k+1) < 3^p. - Hartmut F. W. Hoft, Nov 03 2022

Extensions

Corrected by Ron Knott, Feb 22 2001
a(30) from Zak Seidov, Apr 18 2006
a(32)-a(34) from Lekraj Beedassy, Aug 30 2006

A054640 a(n) is the sum of the divisors of the n-th primorial: a(n) = A000203(A002110(n)).

Original entry on oeis.org

1, 3, 12, 72, 576, 6912, 96768, 1741824, 34836480, 836075520, 25082265600, 802632499200, 30500034969600, 1281001468723200, 56364064623820800, 2705475101943398400, 146095655504943513600, 8765739330296610816000, 543475838478389870592000, 36956357016530511200256000
Offset: 0

Views

Author

Labos Elemer, May 15 2000

Keywords

Crossrefs

Programs

  • Magma
    [1/2*&*[(1+NthPrime(k)): k in [0..n-1]]: n in [1..19]]; // Vincenzo Librandi, May 08 2017
    
  • Maple
    a:= n-> mul(1+ithprime(j), j=1..n): seq(a(n), n=0..20); # Zerinvary Lajos, Aug 24 2008
  • Mathematica
    Table[Product[1 + Prime[i], {i,n-1}], {n,100}] (* Geoffrey Critzer, Dec 01 2014 *)
  • PARI
    a(n)=prod(i=1,n,prime(i)+1) \\ Charles R Greathouse IV, Feb 13 2013
    
  • SageMath
    def A054640(n): return product(nth_prime(j)+1 for j in range(1,n+1))
    [A054640(n) for n in range(41)] # G. C. Greubel, Aug 05 2024

Formula

a(n+1) = a(n)*(prime(n) + 1) = a(n)*A028815(n) (quotient=n-th prime+1 starting with 2).
a(n) ~ (6/Pi^2) * exp(gamma) * A002110(n) * log(prime(n)) + O(A002110(n)) (Jakimczuk, 2017). - Amiram Eldar, Feb 17 2021
a(n) = a(n-1) * A008864(n). - Flávio V. Fernandes, Mar 20 2021
a(n) = A002110(n) + A074107(n), a(n) <= A070826(1+n) [= A002110(1+n)/2] < A051674(n). - Antti Karttunen, Nov 19 2024

Extensions

a(0)=1 prepended by Alois P. Heinz, Apr 01 2021
Showing 1-10 of 88 results. Next