A097250 Smallest m such that A097249(m) = n; from n=1 onwards, twice the primorials, 2*A002110(n).
1, 4, 12, 60, 420, 4620, 60060, 1021020, 19399380, 446185740, 12939386460, 401120980260, 14841476269620, 608500527054420, 26165522663340060, 1229779565176982820, 65178316954380089460, 3845520700308425278140, 234576762718813941966540, 15716643102160534111758180
Offset: 0
Keywords
A277899 a(n) = A097249(A260443(n)).
0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 1, 2, 0, 1, 0, 0, 0, 3, 2, 3, 1, 3, 2, 2, 0, 2, 1, 2, 0, 1, 0, 0, 0, 4, 3, 4, 2, 4, 3, 3, 1, 3, 3, 3, 2, 3, 2, 2, 0, 3, 2, 3, 1, 3, 2, 2, 0, 2, 1, 2, 0, 1, 0, 0, 0, 5, 4, 5, 3, 5, 4, 4, 2, 4, 4, 4, 3, 4, 3, 4, 1, 4, 3, 4, 3, 4, 3, 4, 2, 4, 3, 4, 2, 3, 2, 2, 0, 4, 3, 4, 2, 4, 3, 3, 1, 3, 3, 3, 2, 3, 2, 3, 0, 3, 2, 3, 1, 3, 2, 2, 0
Offset: 0
Keywords
Comments
Links
- Antti Karttunen, Table of n, a(n) for n = 0..8192
Programs
-
Scheme
(define (A277899 n) (A097249_for_coeff_list (A260443as_coeff_list n))) (define (A097249_for_coeff_list nums) (let loop ((nums nums) (s 0)) (if (<= (reduce max 0 nums) 1) s (loop (A097246_for_coeff_list nums) (+ 1 s))))) (define (A097246_for_coeff_list nums) (add_two_lists (map A000035 nums) (cons 0 (map A004526 nums)))) ;; For the other required functions, see A260443.
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).
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
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
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..4096 (first 1025 terms from Antti Karttunen)
Crossrefs
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. A277323, A277324 (bisections), A277200 (even terms sorted), A277197 (first differences), A277198.
Cf. A023758 (positions of squarefree terms), A101082 (of terms not squarefree), A277702 (positions of records), A277703 (their values).
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
Extensions
More linking formulas added by Antti Karttunen, Mar 21 2017
A097248 a(n) is the eventual stable point reached when iterating k -> A097246(k), starting from k = n.
1, 2, 3, 3, 5, 6, 7, 6, 5, 10, 11, 5, 13, 14, 15, 5, 17, 10, 19, 15, 21, 22, 23, 10, 7, 26, 15, 21, 29, 30, 31, 10, 33, 34, 35, 15, 37, 38, 39, 30, 41, 42, 43, 33, 7, 46, 47, 15, 11, 14, 51, 39, 53, 30, 55, 42, 57, 58, 59, 7, 61, 62, 35, 15, 65, 66, 67, 51, 69, 70, 71, 30, 73, 74, 21
Offset: 1
Keywords
Comments
a(n) = r(n,m) with m such that r(n,m)=r(n,m+1), where r(n,k) = A097246(r(n,k-1)), r(n,0)=n. (The original definition.)
A097248(n) = r(n,a(n)).
From Antti Karttunen, Nov 15 2016: (Start)
The above remark could be interpreted to mean that A097249(n) <= a(n).
All terms are squarefree, and the squarefree numbers are the fixed points.
These are also fixed points eventually reached when iterating A277886.
(End)
Links
- Antti Karttunen, Table of n, a(n) for n = 1..10000
Crossrefs
Programs
-
Mathematica
Table[FixedPoint[Times @@ Map[#1^#2 & @@ # &, Partition[#, 2, 2] &@ Flatten[FactorInteger[#] /. {p_, e_} /; e >= 2 :> {If[OddQ@ e, {p, 1}, {1, 1}], {NextPrime@ p, Floor[e/2]}}]] &, n], {n, 75}] (* Michael De Vlieger, Mar 18 2017 *)
-
PARI
A097246(n) = { my(f=factor(n)); prod(i=1, #f~, (nextprime(f[i,1]+1)^(f[i,2]\2))*((f[i,1])^(f[i,2]%2))); }; A097248(n) = { my(k=A097246(n)); while(k<>n, n = k; k = A097246(k)); k; }; \\ Antti Karttunen, Mar 18 2017
-
Python
from sympy import factorint, nextprime from operator import mul def a097246(n): f=factorint(n) return 1 if n==1 else reduce(mul, [(nextprime(i)**int(f[i]/2))*(i**(f[i]%2)) for i in f]) def a(n): k=a097246(n) while k!=n: n=k k=a097246(k) return k # Indranil Ghosh, May 15 2017
-
Scheme
;; with memoization-macro definec ;; Two implementations: (definec (A097248 n) (if (not (zero? (A008683 n))) n (A097248 (A097246 n)))) (definec (A097248 n) (if (zero? (A277885 n)) n (A097248 (A277886 n)))) ;; Antti Karttunen, Nov 15 2016
Formula
From Antti Karttunen, Nov 15 2016: (Start)
A007913(a(n)) = a(n).
(End)
From Peter Munn, Feb 06 2020: (Start)
a(1) = 1; a(p) = p, for prime p; a(m*k) = A331590(a(m), a(k)).
a(A225546(n)) = a(n).
(End)
From Antti Karttunen, Feb 22-25 & Mar 01 2020: (Start)
(End)
Extensions
Name changed and the original definition moved to the Comments section by Antti Karttunen, Nov 15 2016
A097246 Replace factors of n that are squares of a prime with the prime succeeding this prime.
1, 2, 3, 3, 5, 6, 7, 6, 5, 10, 11, 9, 13, 14, 15, 9, 17, 10, 19, 15, 21, 22, 23, 18, 7, 26, 15, 21, 29, 30, 31, 18, 33, 34, 35, 15, 37, 38, 39, 30, 41, 42, 43, 33, 25, 46, 47, 27, 11, 14, 51, 39, 53, 30, 55, 42, 57, 58, 59, 45, 61, 62, 35, 27, 65, 66, 67, 51, 69, 70, 71, 30, 73
Offset: 1
Links
- Antti Karttunen, Table of n, a(n) for n = 1..10000
Crossrefs
Programs
-
Mathematica
Table[Times @@ Map[#1^#2 & @@ # &, Partition[#, 2, 2] &@ Flatten[ FactorInteger[n] /. {p_, e_} /; e >= 2 :> {If[OddQ@ e, {p, 1}, {1, 1}], {NextPrime@ p, Floor[e/2]}}]], {n, 73}] (* Michael De Vlieger, Mar 18 2017 *)
-
PARI
A097246(n) = { my(f=factor(n)); prod(i=1, #f~, (nextprime(f[i, 1]+1)^(f[i,2]\2))*((f[i,1])^(f[i,2]%2))); }; \\ Antti Karttunen, Mar 18 2017
-
Python
from sympy import factorint, nextprime from operator import mul def a(n): f=factorint(n) return 1 if n==1 else reduce(mul, [(nextprime(i)**int(f[i]/2))*(i**(f[i]%2)) for i in f]) # Indranil Ghosh, May 15 2017
-
Scheme
(definec (A097246 n) (if (= 1 n) 1 (* (A000244 (A004526 (A007814 n))) (A000079 (A000035 (A007814 n))) (A003961 (A097246 (A064989 n)))))) (define (A097246 n) (* (A003961 (A000188 n)) (A007913 n))) ;; Antti Karttunen, Nov 15 2016
Formula
Multiplicative with p^e -> NextPrime(p)^floor(e/2) * p^(e mod 2), where p prime and NextPrime(p)=A000040(A049084(p)+1).
a(m*n) <= a(m)*a(n); a(m*n) = a(m)*a(n) iff m and n are coprime;
a(A000040(k)^n) = A000040(k+1)^floor(n/2)*A000040(k)^(n mod 2); a(2^n) = 3^floor(n/2) * (1 + n mod 2);
a(A000040(k)*A002110(n)/A002110(k-1)) = A000040(k+1)*A002110(n)/A002110(k) for k <= n, see also A097250.
From Antti Karttunen, Nov 15 2016: (Start)
(End)
Sum_{k=1..n} a(k) ~ c * n^2, where c = (1/2) * Product_{p prime} (p^4-p^2)/(p^4-nextprime(p)) = 0.4059779303..., where nextprime is A151800. - Amiram Eldar, Nov 29 2022
A322808 Lexicographically earliest such sequence a that a(i) = a(j) => f(i) = f(j) for all i, j, where f(n) = 0 if n is a squarefree number > 2, and f(n) = A097246(n) for all other numbers.
1, 2, 3, 4, 3, 3, 3, 5, 6, 3, 3, 7, 3, 3, 3, 7, 3, 8, 3, 9, 3, 3, 3, 10, 11, 3, 9, 12, 3, 3, 3, 10, 3, 3, 3, 9, 3, 3, 3, 13, 3, 3, 3, 14, 15, 3, 3, 16, 17, 18, 3, 19, 3, 13, 3, 20, 3, 3, 3, 21, 3, 3, 22, 16, 3, 3, 3, 23, 3, 3, 3, 13, 3, 3, 12, 24, 3, 3, 3, 21, 15, 3, 3, 25, 3, 3, 3, 26, 3, 27, 3, 28, 3, 3, 3, 29, 3, 30, 31, 12, 3, 3, 3, 32, 3
Offset: 1
Keywords
Links
- Antti Karttunen, Table of n, a(n) for n = 1..65537
Programs
-
PARI
up_to = 65537; rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om,invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om,invec[i],i); outvec[i] = u; u++ )); outvec; }; A097246(n) = { my(f=factor(n)); prod(i=1, #f~, (nextprime(f[i,1]+1)^(f[i,2]\2))*((f[i,1])^(f[i,2]%2))); }; A322808aux(n) = if((n>2)&&issquarefree(n),0,A097246(n)); v322808 = rgs_transform(vector(up_to,n,A322808aux(n))); A322808(n) = v322808[n];
Comments
Links
Crossrefs
Programs
Mathematica
Formula
Extensions