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
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.
-
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 *)
-
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
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
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.
-
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 *)
-
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
Original entry on oeis.org
2, 13, 101, 1147, 14999, 255223, 4849781, 111546307, 3234846359, 100280244553, 3710369066381, 152125131761557, 6541380665830919, 307444891294237513, 16294579238595005981, 961380175077106286767
Offset: 1
a(4) = 1147 = 31*37.
a(10) = A070826(11) - 2^9 = 100280245065 - 512 = 100280244553 = A000040(4129119109).
-
a(n) = prod(k=1, n+1, prime(k))/2 - 2^(n-1); \\ Michel Marcus, Dec 11 2019
-
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
a(5)=14 because 1155 * 2^14 - 1 = 18923519, a prime.
-
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 *)
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
a(3) = 7, p = {3, 5}, prime(n)# / 2 = 15, {3, 5, 6, 9, 10, 12, 15} - divisible by 3 or 5.
-
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
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
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)
- N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
- Antti Karttunen, Table of n, a(n) for n = 1..8192 (terms 1..1024 from Reinhard Zumkeller)
- Michael De Vlieger, 6 row Doudna Tree diagram as mentioned in Comments.
- Michael De Vlieger, Annotated fan-style binary tree showing 10 levels, with a color function where 2^m is shown in medium blue in row m, k < 2^m is darker blue, and k > 2^m is brighter green, with records in each row shown in red.
- Ronald E. Kutz, Two unusual sequences, Two-Year College Mathematics Journal, Vol. 12, No. 5 (1981), pp. 316-319.
- Index entries for sequences that are permutations of the natural numbers
Cf. also
A000142,
A001511,
A002450,
A112798,
A252463,
A252464,
A252745,
A252750,
A324054,
A324106,
A323505,
A323508.
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.
Positions of multiples of 3:
A091067.
-
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
-
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
-
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 *)
-
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
-
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
-
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
-
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
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
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
Same sequence sorted into ascending order:
A260442.
Cf.
A000040,
A000079,
A000225,
A001222,
A002487,
A003415,
A003961,
A005811,
A007949,
A046523,
A056239,
A073491,
A090880,
A097249,
A101979,
A125184,
A178590,
A186891,
A206284,
A277314,
A277315,
A277325,
A277326,
A277329,
A277330,
A277701,
A277705,
A277899,
A278243,
A278530,
A278544,
A284010,
A284011.
Cf.
A283992,
A283993 (number of irreducible, reducible polynomials in range 1 .. n).
Cf. also
A206296 (Fibonacci polynomials similarly represented).
-
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
-
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 *)
-
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
-
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
-
;; 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)))))))
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
0/1, 1/2, 5/6, 31/30, 247/210, 2927/2310, 40361/30030, 716167/510510, 14117683/9699690, ...
- S. R. Finch, Mathematical Constants, Cambridge, 2003, Sect. 2.2.
- D. S. Mitrinovic et al., Handbook of Number Theory, Kluwer, Sect. VII.28.
Subsequence of
A048103 (after the initial 0).
Cf.
A369972 (k where prime(1+k)|a(k)),
A369973 (corresponding primorials),
A293457 (corresponding primes),
A377992 (antiderivatives of the terms > 1 of this sequence).
-
[ Numerator(&+[ NthPrime(k)^-1: k in [1..n]]): n in [1..18] ]; // Bruno Berselli, Apr 11 2011
-
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
-
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 *)
-
a(n) = numerator(sum(i=1, n, 1/prime(i))); \\ Michel Marcus, Sep 18 2018
-
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
-
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
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
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
-
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
-
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 *)
-
for(nd=1,15,forstep(k=1,10^66,2,if(nd==numdiv(k),print1(k,", ");break())))
-
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
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
-
[1/2*&*[(1+NthPrime(k)): k in [0..n-1]]: n in [1..19]]; // Vincenzo Librandi, May 08 2017
-
a:= n-> mul(1+ithprime(j), j=1..n): seq(a(n), n=0..20); # Zerinvary Lajos, Aug 24 2008
-
Table[Product[1 + Prime[i], {i,n-1}], {n,100}] (* Geoffrey Critzer, Dec 01 2014 *)
-
a(n)=prod(i=1,n,prime(i)+1) \\ Charles R Greathouse IV, Feb 13 2013
-
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
Showing 1-10 of 88 results.
Comments