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-4 of 4 results.

A276150 Sum of digits when n is written in primorial base (A049345); minimal number of primorials (A002110) that add to n.

Original entry on oeis.org

0, 1, 1, 2, 2, 3, 1, 2, 2, 3, 3, 4, 2, 3, 3, 4, 4, 5, 3, 4, 4, 5, 5, 6, 4, 5, 5, 6, 6, 7, 1, 2, 2, 3, 3, 4, 2, 3, 3, 4, 4, 5, 3, 4, 4, 5, 5, 6, 4, 5, 5, 6, 6, 7, 5, 6, 6, 7, 7, 8, 2, 3, 3, 4, 4, 5, 3, 4, 4, 5, 5, 6, 4, 5, 5, 6, 6, 7, 5, 6, 6, 7, 7, 8, 6, 7, 7, 8, 8, 9, 3, 4, 4, 5, 5, 6, 4, 5, 5, 6, 6, 7, 5, 6, 6, 7, 7, 8, 6, 7, 7, 8, 8, 9, 7, 8, 8, 9, 9, 10, 4
Offset: 0

Views

Author

Antti Karttunen, Aug 22 2016

Keywords

Comments

The sum of digits of n in primorial base is odd if n is 1 or 2 (mod 4) and even if n is 0 or 3 (mod 4). Proof: primorials are 1 or 2 (mod 4) and a(n) can be constructed via the greedy algorithm. So if n = 4k + r where 0 <= r < 4, 4k needs an even number of primorials and r needs hammingweight(r) = A000120(r) primorials. Q.E.D. - David A. Corneth, Feb 27 2019

Examples

			For n=24, which is "400" in primorial base (as 24 = 4*(3*2*1) + 0*(2*1) + 0*1, see A049345), the sum of digits is 4, thus a(24) = 4.
		

Crossrefs

Cf. A333426 [k such that a(k)|k], A339215 [numbers not of the form x+a(x) for any x], A358977 [k such that gcd(k, a(k)) = 1].
Cf. A014601, A042963 (positions of even and odd terms), A343048 (positions of records).
Differs from analogous A034968 for the first time at n=24.

Programs

  • Mathematica
    nn = 120; b = MixedRadix[Reverse@ Prime@ NestWhileList[# + 1 &, 1, Times @@ Prime@ Range[# + 1] <= nn &]]; Table[Total@ IntegerDigits[n, b], {n, 0, nn}] (* Version 10.2, or *)
    nn = 120; 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[Total@ f@ n, {n, 0, 120}] (* Michael De Vlieger, Aug 26 2016 *)
  • PARI
    A276150(n) = { my(s=0, p=2, d); while(n, d = (n%p); s += d; n = (n-d)/p; p = nextprime(1+p)); (s); }; \\ Antti Karttunen, Feb 27 2019
  • Python
    from sympy import prime, primefactors
    def Omega(n): return 0 if n==1 else Omega(n//primefactors(n)[0]) + 1
    def a276086(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
    def a(n): return Omega(a276086(n))
    print([a(n) for n in range(201)]) # Indranil Ghosh, Jun 23 2017
    

Formula

a(n) = 1 + a(A276151(n)) = 1 + a(n-A002110(A276084(n))), a(0) = 0.
or for n >= 1: a(n) = 1 + a(n-A260188(n)).
Other identities and observations. For all n >= 0:
a(n) = A001222(A276086(n)) = A001222(A278226(n)).
a(n) >= A371091(n) >= A267263(n).
From Antti Karttunen, Feb 27 2019: (Start)
a(n) = A000120(A277022(n)).
a(A283477(n)) = A324342(n).
(End)
a(n) = A373606(n) + A373607(n). - Antti Karttunen, Jun 19 2024

A060735 a(1)=1, a(2)=2; thereafter, a(n) is the smallest number m not yet in the sequence such that every prime that divides a(n-1) also divides m.

Original entry on oeis.org

1, 2, 4, 6, 12, 18, 24, 30, 60, 90, 120, 150, 180, 210, 420, 630, 840, 1050, 1260, 1470, 1680, 1890, 2100, 2310, 4620, 6930, 9240, 11550, 13860, 16170, 18480, 20790, 23100, 25410, 27720, 30030, 60060, 90090, 120120, 150150, 180180, 210210
Offset: 1

Views

Author

Robert G. Wilson v, Apr 23 2001

Keywords

Comments

Also, numbers k at which k / (phi(k) + 1) increases.
Except for the initial 1, this sequence is a primorial (A002110) followed by its multiples until the next primorial, then the multiples of that primorial and so on. - Wilfredo Lopez (chakotay147138274(AT)yahoo.com), Dec 28 2006
a(1)=1, a(2)=2. For n >= 3, a(n) is the smallest integer > a(n-1) that is divisible by every prime which divides lcm(a(1), a(2), a(3), ..., a(n)). - Leroy Quet, Feb 23 2010
Numbers n for which A053589(n) = A260188(n), thus numbers with only one nonzero digit when written in primorial base A049345. - Antti Karttunen, Aug 30 2016
Lexicographically earliest infinite sequence of distinct positive numbers with property that every prime that divides a(n-1) also divides a(n). - N. J. A. Sloane, Apr 08 2022

Examples

			After a(2)=2 the next term must be even, so a(3)=4.
Then a(4) must be even so a(4) = 6.
Now a(5) must be a multiple of 2*3=6, so a(5)=12.
Then a(6)=18, a(7)=24, a(8)=30.
Now a(9) must be a multiple of 2*3*5 = 30, so a(9)=60. And so on.
		

Crossrefs

Indices of ones in A276157 and A267263.
One more than A343048.

Programs

  • Maple
    seq(seq(k*mul(ithprime(i),i=1..n-1),k=1..ithprime(n)-1),n=1..10); # Vladeta Jovovic, Apr 08 2004
    a := proc(n) option remember; if n=1 then return 1 fi; a(n-1);
    % + convert(numtheory:-factorset(%), `*`) end:
    seq(a(n), n=1..42); # after Zumkeller, Peter Luschny, Aug 30 2016
  • Mathematica
    a = 0; Do[ b = n/(EulerPhi[ n ] + 1); If[ b > a, a = b; Print[ n ] ], {n, 1, 10^6} ]
    f[n_] := Range[Prime[n + 1] - 1] Times @@ Prime@ Range@ n;  Array[f, 7, 0] // Flatten (* Robert G. Wilson v, Jul 22 2015 *)
  • PARI
    first(n)=my(v=vector(n),k=1,p=1,P=1); v[1]=1; for(i=2,n, v[i]=P*k++; if(k>p && isprime(k), p=k; P=v[i]; k=1)); v \\ Charles R Greathouse IV, Jul 22 2015
    
  • PARI
    is_A060735(n,P=1)={forprime(p=2,,n>(P*=p)||return(1);n%P&&return)} \\ M. F. Hasler, Mar 14 2017
    
  • Python
    from functools import cache;
    from sympy import primefactors, prod
    @cache
    def a(n): return 1 if n == 0 else a(n-1) + prod(primefactors(a(n-1)))
    print([a(n) for n in range(42)]) # Trey Deitch, Jun 08 2024

Formula

a(1) = 1, a(n) = a(n-1) + rad(a(n-1)) with rad=A007947, squarefree kernel. - Reinhard Zumkeller, Apr 10 2006
a(A101301(n)+1) = A002110(n). - Enrique Pérez Herrero, Jun 10 2012
a(n) = 1 + A343048(n). - Antti Karttunen, Nov 14 2024

Extensions

Definition corrected by Franklin T. Adams-Watters, Apr 16 2009
Simpler definition, comments, examples from N. J. A. Sloane, Apr 08 2022

A376411 a(n) is the number of terms less than A276086(n) in the range of A276086, where A276086 is the primorial base exp-function.

Original entry on oeis.org

0, 1, 2, 4, 6, 13, 3, 7, 11, 21, 32, 64, 18, 36, 54, 108, 162, 325, 90, 180, 271, 541, 812, 1624, 450, 902, 1354, 2707, 4061, 8122, 5, 10, 15, 30, 45, 91, 25, 50, 75, 151, 227, 454, 126, 253, 378, 758, 1137, 2274, 632, 1264, 1895, 3790, 5685, 11370, 3158, 6317, 9475, 18952, 28428, 56856, 35, 70, 106, 212, 318, 637
Offset: 0

Views

Author

Antti Karttunen, Nov 13 2024

Keywords

Comments

Number of terms of A048103 that are less than A276086(n).
Permutation of nonnegative integers.
Troughs are at primorials, A002110, and the local maxima occur just before, at A057588.

Crossrefs

Cf. A376413 (inverse permutation, but note the different offsets and ranges).
Cf. also A064273 (analogous permutation for base-2).

Programs

  • PARI
    up_to = (2*210)-1; \\ Must be one of the terms of A343048.
    A276085(n) = { my(f = factor(n), pr=1, i=1, s=0); for(k=1, #f~, while(i <= primepi(f[k, 1])-1, pr *= prime(i); i++); s += f[k, 2]*pr); (s); };
    A276086(n) = { my(m=1, p=2); while(n, m *= (p^(n%p)); n = n\p; p = nextprime(1+p)); (m); };
    A359550(n) = { my(pp); forprime(p=2, , pp = p^p; if(!(n%pp), return(0)); if(pp > n, return(1))); };
    A376411list(up_to) = { my(size=up_to, v=vector(size), m=A276086(size), s=1, j); for(i=2,m,if(!(m%i), j=A276085(i); v[j] = s; print1("i=",i," v[",j,"]=",s", ");); s += A359550(i)); (v); };
    v376411 = A376411list(up_to);
    A376411(n) = if(!n,n,v376411[n]);
    
  • PARI
    \\ For incremental computing, less efficient than above:
    A276086(n) = { my(m=1, p=2); while(n, m *= (p^(n%p)); n = n\p; p = nextprime(1+p)); (m); };
    A359550(n) = { my(pp); forprime(p=2, , pp = p^p; if(!(n%pp), return(0)); if(pp > n, return(1))); };
    memoA376411 = Map(); \\ We use k=A276086(n) as our key. kvs will be a list of key-value-pairs sorted into descending order by the key. We search the largest key in it < k, and continue summing from that:
    A376411(n) = if(n<=2,n,my(v, k=A276086(n)); if(mapisdefined(memoA376411,k,&v), v, my(kvs = vecsort(Mat(memoA376411)~,(x,y) -> sign(y[1]-x[1])), ss=si=0); for(i=1, #kvs, if(kvs[1,i]A359550(i)); mapput(memoA376411,k,v); (v)));

Formula

a(n) = A377982(A276086(n))-1 = Sum_{i=1 .. A276086(n)-1} A359550(i).
For all n >= 1, a(A376413(n)) = n-1, and for all n >= 0, A376413(1+a(n)) = n.
a(i)/a(j) ~ A276086(i)/A276086(j), and particularly, a(2*n+1) ~ 2*a(2*n).

A343045 a(0) = 0 and for any n > 0, a(n) = A343044(a(n-1), n).

Original entry on oeis.org

0, 1, 3, 3, 5, 5, 11, 11, 11, 11, 11, 11, 17, 17, 17, 17, 17, 17, 23, 23, 23, 23, 23, 23, 29, 29, 29, 29, 29, 29, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 89, 89, 89, 89, 89, 89, 89
Offset: 0

Views

Author

Rémy Sigrist, Apr 05 2021

Keywords

Comments

This sequence has similarities with A087052 and A343041.
If we remove duplicate terms, then we obtain A343048.

Examples

			The first terms, in decimal and in primorial base, are:
  n   a(n)  prim(n)  prim(a(n))
  --  ----  -------  ----------
   0     0        0           0
   1     1        1           1
   2     3       10          11
   3     3       11          11
   4     5       20          21
   5     5       21          21
   6    11      100         121
   7    11      101         121
   8    11      110         121
   9    11      111         121
  10    11      120         121
  11    11      121         121
  12    17      200         221
  13    17      201         221
  14    17      210         221
		

Crossrefs

Programs

  • PARI
    See Links section.
Showing 1-4 of 4 results.