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 149 results. Next

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

A328114 Maximal digit value used when n is written in primorial base (cf. A049345).

Original entry on oeis.org

0, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
Offset: 0

Views

Author

Antti Karttunen, Oct 12 2019

Keywords

Examples

			For n = 2105, which could be expressed in primorial base for example as "T0021" (where T here stands for the digit value ten), or maybe more elegantly as [10,0,0,2,1] as 2105 = 10*A002110(4) + 2*A002110(1) + 1*A002110(0). The maximum value of these digits is 10, thus a(2105) = 10.
		

Crossrefs

Programs

  • Mathematica
    With[{b = MixedRadix[Reverse@ Prime@ Range@ 20]}, Array[Max@ IntegerDigits[#, b] &, 105, 0]] (* Michael De Vlieger, Oct 30 2019 *)
  • PARI
    A328114(n) = { my(i=0,m=0,pr=1,nextpr); while((n>0),i=i+1; nextpr = prime(i)*pr; if((n%nextpr),m = max(m,(n%nextpr)/pr); n-=(n%nextpr));pr=nextpr); (m); };
    
  • PARI
    A328114(n) = { my(s=0, p=2); while(n, s = max(s,(n%p)); n = n\p; p = nextprime(1+p)); (s); }; \\ (Faster, no unnecessary construction of primorials) - Antti Karttunen, Oct 29 2019

Formula

a(n) = A051903(A276086(n)).
a(A276156(n)) = 1 for all n >= 1.
a(n) <= A276150(n) for all n >= 0.
From Antti Karttunen, Oct 29 2019: (Start)
a(n) = A061395(A328835(n)).
For n >= 1, a(n) < A000040(A235224(n)) and a(n) <= 1 + A328391(n).
For all n >= 1, a(n) = 1+A051903(A328572(n)).
a(A276086(n)) = A328389(n), a(A276087(n)) = A328394(n), a(A328403(n)) = A328398(n).
a(A327860(n)) = A328392(n), a(A003415(n)) = A328390(n), a(A328316(n)) = A328322(n).
(End)

A276084 a(n) = Number of trailing zeros in primorial base representation of n (A049345); largest k such that A002110(k) divides n.

Original entry on oeis.org

0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 3, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 3, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 3, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 3
Offset: 1

Views

Author

Antti Karttunen, Aug 22 2016

Keywords

Comments

Terms begin from a(1)=0 because for zero the count is ambiguous.
From Amiram Eldar, Mar 10 2021: (Start)
The asymptotic density of the occurrences of k is (prime(k+1)-1)/A002110(k+1).
The asymptotic mean of this sequence is Sum_{k>=1} 1/A002110(k) = 0.705230... (A064648). (End)

Examples

			For n=24, which is "400" in primorial base (as 24 = 4*(3*2*1) + 0*(2*1) + 0*1, see A049345), there are two trailing zeros, thus a(24) = 2.
		

Crossrefs

One less than A257993.
Differs from the related A230403 for the first time at n=24.

Programs

  • Mathematica
    Table[If[# == 0, 0, j = #; While[! Divisible[n, Times @@ Prime@ Range@ j], j--]; j] &@ If[OddQ@ n, 0, k = 1; While[Times @@ Prime@ Range[k + 1] <= n, k++]; k], {n, 120}] (* or *)
    nn = 120; b = MixedRadix[Reverse@ Prime@ Range@ PrimePi[nn + 1]]; Table[Length@ TakeWhile[Reverse@ IntegerDigits[n, b], # == 0 &], {n, nn}] (* Version 10.2, or *)
    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[Length@ TakeWhile[Reverse@ f@ n, # == 0 &], {n, 120}] (* Michael De Vlieger, Aug 30 2016 *)
  • Python
    from sympy import nextprime, primepi
    def a053669(n):
        p = 2
        while True:
            if n%p!=0: return p
            else: p=nextprime(p)
    def a(n): return primepi(a053669(n)) - 1 # Indranil Ghosh, May 12 2017
  • Scheme
    (define (A276084 n) (let loop ((n n) (i 1)) (let* ((p (A000040 i)) (d (modulo n p))) (if (not (zero? d)) (- i 1) (loop (/ (- n d) p) (+ 1 i))))))
    

Formula

a(n) = A257993(n)-1.
Other identities. For all n >= 1:
A053589(n) = A002110(a(n)).
a(n) = A001221(A053589(n)) = A001221(A340346(n)). - Peter Munn, Jan 14 2021

A342050 Numbers k which have an odd number of trailing zeros in their primorial base representation A049345(k).

Original entry on oeis.org

2, 4, 8, 10, 14, 16, 20, 22, 26, 28, 30, 32, 34, 38, 40, 44, 46, 50, 52, 56, 58, 60, 62, 64, 68, 70, 74, 76, 80, 82, 86, 88, 90, 92, 94, 98, 100, 104, 106, 110, 112, 116, 118, 120, 122, 124, 128, 130, 134, 136, 140, 142, 146, 148, 150, 152, 154, 158, 160, 164, 166, 170, 172, 176, 178, 180, 182, 184, 188, 190, 194, 196, 200, 202, 206, 208, 212
Offset: 1

Views

Author

Amiram Eldar, Feb 26 2021

Keywords

Comments

Numbers k such that A276084(k) is odd.
All the terms are even since odd numbers have 0 trailing zeros, and 0 is not odd.
The number of terms not exceeding A002110(m) for m>=1 is A002110(m) * Sum_{k=1..m}(-1)^k/A002110(k) = 1, 2, 11, 76, 837, 10880, 184961, ...
The asymptotic density of this sequence is Sum_{k>=1} (-1)^(k+1)/A002110(k) = 0.362306... (A132120).
Also Heinz numbers of partitions with even least gap. The least gap (mex or minimal excludant) of a partition is the least positive integer that is not a part. The Heinz number of a partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k), giving a bijective correspondence between positive integers and integer partitions. - Gus Wiseman, Apr 23 2021
Numbers k such that A000720(A053669(k)) is even. Differences from the related A353531 seem to be terms that are multiples of 210, but not all of them, for example primorial 30030 (= 143*210) is in neither sequence. Consider also A038698. - Antti Karttunen, Apr 25 2022

Examples

			2 is a term since A049345(2) = 10 has 1 trailing zero.
4 is a term since A049345(2) = 20 has 1 trailing zero.
30 is a term since A049345(2) = 1000 has 3 trailing zeros.
From _Gus Wiseman_, Apr 23 2021: (Start)
The sequence of terms together with their prime indices begins:
      2: {1}             46: {1,9}             90: {1,2,2,3}
      4: {1,1}           50: {1,3,3}           92: {1,1,9}
      8: {1,1,1}         52: {1,1,6}           94: {1,15}
     10: {1,3}           56: {1,1,1,4}         98: {1,4,4}
     14: {1,4}           58: {1,10}           100: {1,1,3,3}
     16: {1,1,1,1}       60: {1,1,2,3}        104: {1,1,1,6}
     20: {1,1,3}         62: {1,11}           106: {1,16}
     22: {1,5}           64: {1,1,1,1,1,1}    110: {1,3,5}
     26: {1,6}           68: {1,1,7}          112: {1,1,1,1,4}
     28: {1,1,4}         70: {1,3,4}          116: {1,1,10}
     30: {1,2,3}         74: {1,12}           118: {1,17}
     32: {1,1,1,1,1}     76: {1,1,8}          120: {1,1,1,2,3}
     34: {1,7}           80: {1,1,1,1,3}      122: {1,18}
     38: {1,8}           82: {1,13}           124: {1,1,11}
     40: {1,1,1,3}       86: {1,14}           128: {1,1,1,1,1,1,1}
     44: {1,1,5}         88: {1,1,1,5}        130: {1,3,6}
(End)
		

Crossrefs

Complement of A342051.
A099800 is subsequence.
Analogous sequences: A001950 (Zeckendorf representation), A036554 (binary), A145204 (ternary), A217319 (base 4), A232745 (factorial base).
The version for reversed binary expansion is A079523.
Positions of even terms in A257993.
A000070 counts partitions with a selected part.
A056239 adds up prime indices, row sums of A112798.
A073491 lists numbers with gap-free prime indices.
A079067 counts gaps in prime indices.
A238709 counts partitions by sum and least difference.
A333214 lists positions of adjacent unequal prime gaps.
A339662 gives greatest gap in prime indices.
Differs from A353531 for the first time at n=77, where a(77) = 212, as this sequence misses A353531(77) = 210.

Programs

  • Mathematica
    seq[max_] := Module[{bases = Prime@Range[max, 1, -1], nmax}, nmax = Times @@ bases - 1; Select[Range[nmax], OddQ @ LengthWhile[Reverse @ IntegerDigits[#, MixedRadix[bases]], #1 == 0 &] &]]; seq[4]
    Select[Range[100],EvenQ[Min@@Complement[Range[PrimeNu[#]+1],PrimePi/@First/@FactorInteger[#]]]&] (* Gus Wiseman, Apr 23 2021 *)
  • PARI
    A353525(n) = { for(i=1,oo,if(n%prime(i),return((i+1)%2))); }
    isA342050(n) = A353525(n);
    k=0; n=0; while(k<77, n++; if(isA342050(n), k++; print1(n,", "))); \\ Antti Karttunen, Apr 25 2022

Extensions

More terms added (to differentiate from A353531) by Antti Karttunen, Apr 25 2022

A276154 a(n) = Shift primorial base representation (A049345) of n left by one digit (append one zero to the right, then convert back to decimal).

Original entry on oeis.org

0, 2, 6, 8, 12, 14, 30, 32, 36, 38, 42, 44, 60, 62, 66, 68, 72, 74, 90, 92, 96, 98, 102, 104, 120, 122, 126, 128, 132, 134, 210, 212, 216, 218, 222, 224, 240, 242, 246, 248, 252, 254, 270, 272, 276, 278, 282, 284, 300, 302, 306, 308, 312, 314, 330, 332, 336, 338, 342, 344, 420, 422, 426, 428, 432, 434, 450, 452, 456, 458, 462, 464, 480, 482, 486, 488
Offset: 0

Views

Author

Antti Karttunen, Aug 24 2016

Keywords

Examples

			   n   A049345  with one zero           converted back
                appended to the right   to decimal = a(n)
---------------------------------------------------------
   0       0            00                     0
   1       1            10                     2
   2      10           100                     6
   3      11           110                     8
   4      20           200                    12
   5      21           210                    14
   6     100          1000                    30
   7     101          1010                    32
   8     110          1100                    36
   9     111          1110                    38
  10     120          1200                    42
  11     121          1210                    44
  12     200          2000                    60
  13     201          2010                    62
  14     210          2100                    66
  15     211          2110                    68
  16     220          2200                    72
		

Crossrefs

Complement: A276155.
Cf. A002110, A003961, A049345, A276085, A276086, A276151, A276152, A286629 [= a(A061720(n-1))], A324384 [= gcd(n, a(n))], A323879, A328770 (a subsequence).
Cf. also A276156, A328461, A328464.
Dispersion array and its transpose: A276943, A276945, with primorials divided out: A286623, A286625.
Analogous to A153880.

Programs

  • Mathematica
    nn = 75; b = MixedRadix[Reverse@ Prime@ NestWhileList[# + 1 &, 1, Times @@ Prime@ Range[#] <= nn &]]; Table[FromDigits[#, b] &@ Append[IntegerDigits[n, b], 0], {n, 0, nn}] (* Version 10.2, or *)
    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[Times @@@ Transpose@ {Map[Times @@ # &, Prime@ Range@ Range[0, Length@ # - 1]], Reverse@ #}] &@ Append[f@ n, 0], {n, 0, 75}] (* Michael De Vlieger, Aug 26 2016 *)
  • PARI
    A276154(n) = A276085(A003961(A276086(n))); \\ Antti Karttunen, Mar 15 2021
    
  • PARI
    A276151(n) = { my(s=1); forprime(p=2, , if(n%p, return(n-s), s *= p)); };
    A276152(n) = { my(s=1); forprime(p=2, , if(n%p, return(s*p), s *= p)); };
    A276154(n) = if(!n,n,(A276152(n) + A276154(A276151(n)))); \\ Antti Karttunen, Mar 15 2021
    
  • Scheme
    (definec (A276154 n) (if (zero? n) n (+ (A276152 n) (A276154 (A276151 n)))))

Formula

a(0) = 0; for n >= 1, a(n) = A276152(n) + a(A276151(n)).
a(n) = A276085(A003961(A276086(n))). - Antti Karttunen, Mar 15 2021

A342051 Numbers k which have an even number of trailing zeros in their primorial base representation A049345(k).

Original entry on oeis.org

1, 3, 5, 6, 7, 9, 11, 12, 13, 15, 17, 18, 19, 21, 23, 24, 25, 27, 29, 31, 33, 35, 36, 37, 39, 41, 42, 43, 45, 47, 48, 49, 51, 53, 54, 55, 57, 59, 61, 63, 65, 66, 67, 69, 71, 72, 73, 75, 77, 78, 79, 81, 83, 84, 85, 87, 89, 91, 93, 95, 96, 97, 99, 101, 102, 103
Offset: 1

Views

Author

Amiram Eldar, Feb 26 2021

Keywords

Comments

Numbers k such that A276084(k) is even.
The number of terms not exceeding A002110(m) for m>=1 is A002110(m) * (1 - Sum_{k=1..m}(-1)^k/A002110(k)) = 1, 4, 19, 134, 1473, 19150, 325549 ...
The asymptotic density of this sequence is Sum_{k>=0} (-1)^k/A002110(k) = 0.637693... = 1 - A132120.
Also Heinz numbers of partitions with odd least gap. The least gap (mex or minimal excludant) of a partition is the least positive integer that is not a part. The Heinz number of a partition (y_1,...,y_k) is prime(y_1)*...*prime(y_k), giving a bijective correspondence between positive integers and integer partitions. - Gus Wiseman, Apr 23 2021

Examples

			1 is a term since A049345(1) = 1 has 0 trailing zero.
6 is a term since A049345(6) = 100 has 2 trailing zeros.
From _Gus Wiseman_, Apr 23 2021: (Start)
The sequence of terms together with their prime indices begins:
     1: {}           25: {3,3}          51: {2,7}
     3: {2}          27: {2,2,2}        53: {16}
     5: {3}          29: {10}           54: {1,2,2,2}
     6: {1,2}        31: {11}           55: {3,5}
     7: {4}          33: {2,5}          57: {2,8}
     9: {2,2}        35: {3,4}          59: {17}
    11: {5}          36: {1,1,2,2}      61: {18}
    12: {1,1,2}      37: {12}           63: {2,2,4}
    13: {6}          39: {2,6}          65: {3,6}
    15: {2,3}        41: {13}           66: {1,2,5}
    17: {7}          42: {1,2,4}        67: {19}
    18: {1,2,2}      43: {14}           69: {2,9}
    19: {8}          45: {2,2,3}        71: {20}
    21: {2,4}        47: {15}           72: {1,1,1,2,2}
    23: {9}          48: {1,1,1,1,2}    73: {21}
    24: {1,1,1,2}    49: {4,4}          75: {2,3,3}
(End)
		

Crossrefs

Complement of A342050.
A099788 is subsequence.
Analogous sequences: A000201 (Zeckendorf representation), A003159 (binary), A007417 (ternary), A232744 (factorial base).
The version for reversed binary expansion is A121539.
Positions of odd terms in A257993.
A000070 counts partitions with a selected part.
A056239 adds up prime indices, row sums of A112798.
A073491 lists numbers with gap-free prime indices.
A079067 counts gaps in prime indices.
A238709 counts partitions by sum and least difference.
A339662 gives greatest gap in prime indices.

Programs

  • Mathematica
    seq[max_] := Module[{bases = Prime@Range[max, 1, -1], nmax}, nmax = Times @@ bases - 1; Select[Range[nmax], EvenQ @ LengthWhile[Reverse @ IntegerDigits[#, MixedRadix[bases]], #1 == 0 &] &]]; seq[4]
    Select[Range[100],OddQ[Min@@Complement[Range[PrimeNu[#]+1],PrimePi/@First/@FactorInteger[#]]]&] (* Gus Wiseman, Apr 23 2021 *)

A276153 The most significant digit when n is written in primorial base (A049345).

Original entry on oeis.org

0, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4
Offset: 0

Views

Author

Antti Karttunen, Aug 22 2016

Keywords

Examples

			For n=24, which is "400" in primorial base (as 24 = 4*(3*2*1) + 0*(2*1) + 0*1, see A049345), the most significant digit is 4, thus a(24) = 4.
For n=210, which is "10000" in primorial base (as 210 = A002110(4) = 7*5*3*2*1), the most significant digit is 1, thus a(210) = 1.
For n=2100, which could be written "A0000" in primorial base (where A stands for digit "ten", as 2100 = 10*A002110(4)), the most significant value holder is thus 10 and a(2100) = 10. (The first point where this sequence attains a value larger than 9).
		

Crossrefs

Differs from A099563 for the first time at n=24.
Differs from A099564 for the first time at n=210, where a(210)=1, while A099564(210)=7.

Programs

  • Mathematica
    nn = 120; Table[First@ IntegerDigits[n, MixedRadix[Reverse@ Prime@ Range@ PrimePi@ nn]], {n, 0, nn}] (* Michael De Vlieger, Aug 25 2016, Version 10.2 *)
  • Scheme
    (define (A276153 n) (let loop ((n n) (i 1)) (let* ((p (A000040 i)) (dig (modulo n p)) (next-n (/ (- n dig) p))) (if (zero? next-n) dig (loop next-n (+ 1 i))))))

Formula

a(n) = A071178(A276086(n)).

A373605 Sum of the even-indexed digits minus the sum of the odd-indexed digits in the primorial base representation (A049345) of n.

Original entry on oeis.org

0, 1, -1, 0, -2, -1, 1, 2, 0, 1, -1, 0, 2, 3, 1, 2, 0, 1, 3, 4, 2, 3, 1, 2, 4, 5, 3, 4, 2, 3, -1, 0, -2, -1, -3, -2, 0, 1, -1, 0, -2, -1, 1, 2, 0, 1, -1, 0, 2, 3, 1, 2, 0, 1, 3, 4, 2, 3, 1, 2, -2, -1, -3, -2, -4, -3, -1, 0, -2, -1, -3, -2, 0, 1, -1, 0, -2, -1, 1, 2, 0, 1, -1, 0, 2, 3, 1, 2, 0, 1, -3, -2, -4, -3, -5, -4, -2, -1, -3
Offset: 0

Views

Author

Antti Karttunen, Jun 18 2024

Keywords

Comments

Alternating digit sum in primorial base, starting with a positive sign for the rightmost (least significant) digit.

Examples

			A049345(85) = 2401, thus the sum of digits at even positions (with the rightmost digit having index 0) is 1+4 = 5, and at the odd positions 0+2 = 2, therefore a(85) = 5-2 = 3.
		

Crossrefs

Cf. A049345, A195017, A276086, A373606, A373607, A373830, A373831 (indices of multiples of 3).
Analogous sequences for bases 2-10: A065359, A065368, A346688, A346689, A346690, A346691, A346731, A346732, A055017.

Programs

  • PARI
    A373605(n) = { my(p=2, i=1, s=0); while(n, s += i*(n%p); n = n\p; p = nextprime(1+p); i = -i); (s); };

Formula

a(n) = A373606(n) - A373607(n).
a(n) = A195017(A276086(n)).

A276155 Complement of A276154; numbers that cannot be obtained by shifting left the primorial base representation (A049345) of some number.

Original entry on oeis.org

1, 3, 4, 5, 7, 9, 10, 11, 13, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 31, 33, 34, 35, 37, 39, 40, 41, 43, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 61, 63, 64, 65, 67, 69, 70, 71, 73, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 91, 93, 94, 95, 97, 99, 100, 101, 103, 105, 106, 107, 108, 109
Offset: 1

Views

Author

Antti Karttunen, Aug 24 2016

Keywords

Comments

The first 25 terms, when viewed in primorial base (A049345) look as: 1, 11, 20, 21, 101, 111, 120, 121, 201, 211, 220, 221, 300, 301, 310, 311, 320, 321, 400, 401, 410, 411, 420, 421, 1001.

Crossrefs

Complement: A276154.
Row 1 of A276943 and A286623. Column 1 of A276945 and A286625.
Cf. A005408, A057588, A061720, A143293, A286630 (subsequences).
For the first 17 terms coincides with A273670.

Programs

  • Mathematica
    nn = 109; b = MixedRadix[Reverse@ Prime@ NestWhileList[# + 1 &, 1, Times @@ Prime@ Range[# + 1] <= nn &]]; Complement[Range@ nn, Table[FromDigits[#, b] &@ Append[IntegerDigits[n, b], 0], {n, 0, nn}]] (* Version 10.2, or *)
    nn = 109; 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]]]; Complement[Range@ nn, Table[Total[Times @@@ Transpose@ {Map[Times @@ # &, Prime@ Range@ Range[0, Length@ # - 1]], Reverse@ #}] &@ Append[f@ n, 0], {n, 0, nn}]] (* Michael De Vlieger, Aug 26 2016 *)

A358673 Numbers k such that for all factorizations of k as x*y, the sum (x * y') + (x' * y) is carryfree when the addition is done in the primorial base, A049345. Here n' stands for A003415(n), the arithmetic derivative of n.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 11, 12, 13, 14, 17, 18, 19, 23, 26, 27, 29, 31, 37, 38, 41, 43, 47, 53, 59, 61, 62, 63, 67, 70, 71, 73, 74, 79, 83, 86, 89, 97, 99, 101, 103, 107, 109, 113, 117, 122, 127, 131, 134, 137, 139, 146, 149, 151, 153, 154, 157, 158, 163, 167, 173, 179, 181, 186, 190, 191, 193, 194, 195
Offset: 1

Views

Author

Antti Karttunen, Nov 26 2022

Keywords

Comments

Numbers k such that there are no factorization of k into such a pair of natural numbers x and y, that the sum (x * A003415(y)) + (A003415(x) * y) would generate any carries when the addition is done in the primorial base.

Examples

			Refer to the examples in A358235 to see why 6 and 63 are terms of this sequence, while 24 is not.
See also examples in A380525.
		

Crossrefs

Cf. A003415, A049345, A358235, A358672 (characteristic function), A358674 (complement).
Subsequences: A000040, A380525 (squarefree terms), A380468.
Cf. also A358671.

Programs

Formula

{k such that A358235(k) = A038548(k)}.
Showing 1-10 of 149 results. Next