A369247 Number of representations of 3*A057588(n) as a sum (p*q + p*r + q*r) with three odd primes p <= q <= r, where A057588 is Kummer numbers, one less than primorials.
0, 0, 1, 3, 2, 6, 10, 12, 50, 178, 150
Offset: 1
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.
Do[ Print[ PrimePi[ FactorInteger[ Product[ Prime[k], {k, 1, n}] - 1] [[1, 1]]]], {n, 2, 22} ]
[a: n in [2..20]| not IsPrime(a) where a is -1+&*[NthPrime(k):k in [1..n]]]; // Marius A. Burtea, Feb 18 2020
a(9) = 23# = 2*3*5*7*11*13*17*19*23 = 223092870 divides the difference 5283234035979900 in the arithmetic progression of 26 primes A204189. - _Jonathan Sondow_, Jan 15 2012
a002110 n = product $ take n a000040_list a002110_list = scanl (*) 1 a000040_list -- Reinhard Zumkeller, Feb 19 2012, May 03 2011
[1] cat [&*[NthPrime(i): i in [1..n]]: n in [1..20]]; // Bruno Berselli, Oct 24 2012
[1] cat [&*PrimesUpTo(p): p in PrimesUpTo(60)]; // Bruno Berselli, Feb 08 2015
A002110 := n -> mul(ithprime(i),i=1..n);
FoldList[Times, 1, Prime[Range[20]]] primorial[n_] := Product[Prime[i], {i, n}]; Array[primorial,20] (* José María Grau Ribas, Feb 15 2010 *) Join[{1}, Denominator[Accumulate[1/Prime[Range[20]]]]] (* Harvey P. Dale, Apr 11 2012 *)
a(n)=prod(i=1,n, prime(i)) \\ Washington Bomfim, Sep 23 2008
p=1; for (n=0, 100, if (n, p*=prime(n)); write("b002110.txt", n, " ", p) ) \\ Harry J. Smith, Nov 13 2009
a(n) = factorback(primes(n)) \\ David A. Corneth, May 06 2018
from sympy import primorial def a(n): return 1 if n < 1 else primorial(n) [a(n) for n in range(51)] # Indranil Ghosh, Mar 29 2017
[sloane.A002110(n) for n in (1..20)] # Giuseppe Coppoletta, Dec 05 2014
; with memoization-macro definec (definec (A002110 n) (if (zero? n) 1 (* (A000040 n) (A002110 (- n 1))))) ;; Antti Karttunen, Aug 30 2016
For n = 24, which has primorial base representation (see A049345) "400" as 24 = 4*A002110(2) + 0*A002110(1) + 0*A002110(0) = 4*6 + 0*2 + 0*1, thus a(24) = prime(3)^4 * prime(2)^0 * prime(1)^0 = 5^4 = 625. For n = 35 = "1021" as 35 = 1*A002110(3) + 0*A002110(2) + 2*A002110(1) + 1*A002110(0) = 1*30 + 0*6 + 2*2 + 1*1, thus a(35) = prime(4)^1 * prime(2)^2 * prime(1) = 7 * 3*3 * 2 = 126.
b = MixedRadix[Reverse@ Prime@ Range@ 12]; Table[Function[k, Times @@ Power @@@ # &@ Transpose@ {Prime@ Range@ Length@ k, Reverse@ k}]@ IntegerDigits[n, b], {n, 0, 51}] (* Michael De Vlieger, Aug 23 2016, Version 10.2 *) f[n_] := Block[{a = {{0, n}}}, Do[AppendTo[a, {First@ #, Last@ #} &@ QuotientRemainder[a[[-1, -1]], Times @@ Prime@ Range[# - i]]], {i, 0, #}] &@ NestWhile[# + 1 &, 0, Times @@ Prime@ Range[# + 1] <= n &]; Rest[a][[All, 1]]]; Table[Times @@ Flatten@ MapIndexed[Prime[#2]^#1 &, Reverse@ f@ n], {n, 0, 73}] (* Michael De Vlieger, Aug 30 2016, Pre-Version 10 *) a[n0_] := Module[{m = 1, i = 1, n = n0, p}, While[n > 0, p = Prime[i]; m *= p^Mod[n, p]; n = Quotient[n, p]; i++]; m]; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Dec 01 2021, after Antti Karttunen's Sage code *)
A276086(n) = { my(i=0,m=1,pr=1,nextpr); while((n>0),i=i+1; nextpr = prime(i)*pr; if((n%nextpr),m*=(prime(i)^((n%nextpr)/pr));n-=(n%nextpr));pr=nextpr); m; }; \\ Antti Karttunen, May 12 2017
A276086(n) = { my(m=1, p=2); while(n, m *= (p^(n%p)); n = n\p; p = nextprime(1+p)); (m); }; \\ (Better than above one, avoids unnecessary construction of primorials). - Antti Karttunen, Oct 14 2019
from sympy import prime def a(n): i=0 m=pr=1 while n>0: i+=1 N=prime(i)*pr if n%N!=0: m*=(prime(i)**((n%N)/pr)) n-=n%N pr=N return m # Indranil Ghosh, May 12 2017, after Antti Karttunen's PARI code
from sympy import nextprime def a(n): m, p = 1, 2 while n > 0: n, r = divmod(n, p) m *= p**r p = nextprime(p) return m print([a(n) for n in range(74)]) # Peter Luschny, Apr 20 2024
def A276086(n): m=1 i=1 while n>0: p = sloane.A000040(i) m *= (p**(n%p)) n = floor(n/p) i += 1 return (m) # Antti Karttunen, Oct 14 2019, after Indranil Ghosh's Python code above, and my own leaner PARI code from Oct 14 2019. This avoids unnecessary construction of primorials.
(define (A276086 n) (let loop ((n n) (t 1) (i 1)) (if (zero? n) t (let* ((p (A000040 i)) (d (modulo n p))) (loop (/ (- n d) p) (* t (expt p d)) (+ 1 i))))))
(definec (A276086 n) (if (zero? n) 1 (* (expt (A053669 n) (A276088 n)) (A276086 (A276093 n))))) ;; Needs macro definec from http://oeis.org/wiki/Memoization#Scheme
(definec (A276086 n) (if (zero? n) 1 (* (A053669 n) (A276086 (- n (A002110 (A276084 n))))))) ;; Needs macro definec from http://oeis.org/wiki/Memoization#Scheme
6 = 2^1 * 3^1 is OK but 12 = 2^2 * 3^1 is not. 625 = 5^4 is present because it is not divisible by 5^5.
a048103 n = a048103_list !! (n-1) a048103_list = filter (\x -> and $ zipWith (>) (a027748_row x) (map toInteger $ a124010_row x)) [1..] -- Reinhard Zumkeller, Apr 28 2012
{1}~Join~Select[Range@ 120, Times @@ Boole@ Map[First@ # > Last@ # &, FactorInteger@ #] > 0 &] (* Michael De Vlieger, Aug 19 2016 *)
isok(n) = my(f=factor(n)); for (i=1, #f~, if (f[i,1] <= f[i,2], return(0))); return(1); \\ Michel Marcus, Nov 13 2020
A359550(n) = { my(pp); forprime(p=2, , pp = p^p; if(!(n%pp), return(0)); if(pp > n, return(1))); }; \\ (A359550 is the characteristic function for A048103) - Antti Karttunen, Nov 18 2024
from itertools import count, islice from sympy import factorint def A048103_gen(startvalue=1): # generator of terms >= startvalue return filter(lambda n:all(map(lambda d:d[1]A048103_list = list(islice(A048103_gen(),30)) # Chai Wah Wu, Jan 05 2023
;; With Antti Karttunen's IntSeq-library. (define A048103 (ZERO-POS 1 1 A129251)) ;; Antti Karttunen, Aug 18 2016
It is a universal convention that an empty product is 1 (just as an empty sum is 0), and since this sequence has offset 0, the first term is 1+1 = 2. - _N. J. A. Sloane_, Dec 02 2015
[2] cat [&*PrimesUpTo(p)+1: p in PrimesUpTo(70)]; // Vincenzo Librandi, Dec 03 2015
with(numtheory): A006862 := proc(n) local i; if n=0 then 2 else 1+product('ithprime(i)','i'=1..n); fi; end; # second Maple program: a:= proc(n) option remember; `if`(n=0, 2, 1+ithprime(n)*(a(n-1)-1)) end: seq(a(n), n=0..20); # Alois P. Heinz, Feb 06 2021
Table[Product[Prime[k], {k, 1, n}] + 1, {n, 1, 18}] 1 + FoldList[Times, 1, Prime@ Range@ 19] (* Harvey P. Dale, Dec 02 2015 and modified by Robert G. Wilson v, Mar 25 2017 *)
a(n)=my(v=primes(n)); prod(i=1,#v,v[i])+1 \\ Charles R Greathouse IV, Nov 20 2012
from sympy import primorial def A006862(n): if n == 0: return 2 else: return 1 + primorial(n) # Karl-Heinz Hofmann, Aug 21 2024
a(27) = 1 as 27 can be expressed in exactly one way in the form (p*q + p*r + q*r), with p, q, r all being 3 in this case, as 27 = (3*3 + 3*3 + 3*3). a(311) = 5 as 311 = (3*5 + 3*37 + 5*37) = (3*7 + 3*29 + 7*29) = (3*13 + 3*17 + 13*17) = (5*7 + 5*23 + 7*23) = (7*11 + 7*13 + 11*13). Expressed in the terms of arithmetic derivatives, of the A099302(311) = 8 antiderivatives of 311 [366, 430, 494, 555, 609, 663, 805, 1001], only the last five are products of three odd primes: 555 = 3*5*37, 609 = 3*7*29, 663 = 3*13*17, 805 = 5*7*23, 1001 = 7 * 11 * 13.
\\ Use this for building up a list up to a certain n. We iterate over weakly increasing triplets of odd primes: A369054list(up_to) = { my(v = [3,3,3], ip = #v, d, u = vector(up_to)); while(1, d = ((v[1]*v[2]) + (v[1]*v[3]) + (v[2]*v[3])); if(d > up_to, ip--, ip = #v; u[d]++); if(!ip, return(u)); v[ip] = nextprime(1+v[ip]); for(i=1+ip,#v,v[i]=v[i-1])); }; v369054 = A369054list(100001); A369054(n) = if(!n,n,v369054[n]);
\\ Use this for computing the value of arbitrary n. We iterate over weakly increasing pairs of odd primes: A369054(n) = if(3!=(n%4),0, my(v = [3,3], ip = #v, r, c=0); while(1, r = (n-(v[1]*v[2])) / (v[1]+v[2]); if(r < v[2], ip--, ip = #v; if(1==denominator(r) && isprime(r),c++)); if(!ip, return(c)); v[ip] = nextprime(1+v[ip]); for(i=1+ip,#v,v[i]=v[i-1])));
a057705 n = a057705_list !! (n-1) a057705_list = filter ((== 1) . a010051) a057588_list -- Reinhard Zumkeller, Mar 27 2013
Select[FoldList[Times, 1, Prime[Range[70]]], PrimeQ[# - 1] &] - 1 (* Harvey P. Dale, Jan 27 2014 *)
10 is not a term as 6 is a member with the same prime signature 10 > 6. 216 is a term as 216 = (2*3)^3. 243 is not a term as 32 represents that prime signature.
unintQ[n_]:=And[SameQ@@Last/@FactorInteger[n],Length[FactorInteger[n]]==PrimePi[FactorInteger[n][[-1,1]]]]; Select[Range[1000],unintQ] (* Gus Wiseman, Dec 26 2018 *)
Comments