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

A028983 Numbers whose sum of divisors is even.

Original entry on oeis.org

3, 5, 6, 7, 10, 11, 12, 13, 14, 15, 17, 19, 20, 21, 22, 23, 24, 26, 27, 28, 29, 30, 31, 33, 34, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 65, 66, 67, 68, 69, 70, 71, 73, 74, 75, 76, 77, 78, 79, 80, 82
Offset: 1

Views

Author

Keywords

Comments

The even terms of this sequence are the even terms appearing in A178910. [Edited by M. F. Hasler, Oct 02 2014]
A071324(a(n)) is even. - Reinhard Zumkeller, Jul 03 2008
Sigma(a(n)) = A000203(a(n)) = A152678(n). - Jaroslav Krizek, Oct 06 2009
A083207 is a subsequence. - Reinhard Zumkeller, Jul 19 2010
Numbers k such that the number of odd divisors of k (A001227) is even. - Omar E. Pol, Apr 04 2016
Numbers k such that the sum of odd divisors of k (A000593) is even. - Omar E. Pol, Jul 05 2016
Numbers with a squarefree part greater than 2. - Peter Munn, Apr 26 2020
Equivalently, numbers whose odd part is nonsquare. Compare with the numbers whose square part is even (i.e., nonodd): these are the positive multiples of 4, A008586\{0}, and A225546 provides a self-inverse bijection between the two sets. - Peter Munn, Jul 19 2020
Also numbers whose reversed prime indices have alternating product > 1, where we define the alternating product of a sequence (y_1,...,y_k) to be Product_i y_i^((-1)^(i-1)). Also Heinz numbers of the partitions counted by A347448. - Gus Wiseman, Oct 29 2021
Numbers whose number of middle divisors is not odd (cf. A067742). - Omar E. Pol, Aug 02 2022

Crossrefs

The complement is A028982 = A000290 U A001105.
Subsequences: A083207, A091067, A145204\{0}, A225838, A225858.
Cf. A334748 (a permutation).
Related to A008586 via A225546.
Ranks the partitions counted by A347448, complement A119620.

Programs

  • Mathematica
    Select[Range[82],EvenQ[DivisorSigma[1,#]]&] (* Jayanta Basu, Jun 05 2013 *)
  • PARI
    is(n)=!issquare(n)&&!issquare(n/2) \\ Charles R Greathouse IV, Jan 11 2013
    
  • Python
    from math import isqrt
    def A028983(n):
        def f(x): return n-1+isqrt(x)+isqrt(x>>1)
        kmin, kmax = 1,2
        while f(kmax) >= kmax:
            kmax <<= 1
        while True:
            kmid = kmax+kmin>>1
            if f(kmid) < kmid:
                kmax = kmid
            else:
                kmin = kmid
            if kmax-kmin <= 1:
                break
        return kmax # Chai Wah Wu, Aug 22 2024

Formula

a(n) ~ n. - Charles R Greathouse IV, Jan 11 2013
a(n) = n + (1 + sqrt(2)/2)*sqrt(n) + O(1). - Charles R Greathouse IV, Sep 01 2015
A007913(a(n)) > 2. - Peter Munn, May 05 2020

A051064 3^a(n) exactly divides 3n. Or, 3-adic valuation of 3n.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

a(n) is the Hamming distance between n and n-1 in ternary representation. - Philippe Deléham, Mar 29 2004
3^a(n) divides 4^n-1. - Benoit Cloitre, Oct 25 2004
Generalized Ruler Function for k=3. - Frank Ruskey and Chris Deugau (deugaucj(AT)uvic.ca)
a(A007417(n)) is odd and a(A145204(n)) is even. - Reinhard Zumkeller, May 23 2013
First n terms comprise least cubefree word of length n using positive integers, where "cubefree" means that the word contains no three consecutive identical subwords; e.g., 1 contains no cube; 11 contains no cube; 111 does but 112 does not; ... 1,1,2,1,1,2,1,1,1 does, and 1,1,2,1,1,2,1,1,2 does, but 1,1,2,1,1,2,1,1,3 does not, etc. - Clark Kimberling, Sep 10 2013
The sequence is invariant under the "lower trim" operator: remove all ones, and subtract one from each remaining term. - Franklin T. Adams-Watters, May 25 2017
a(n) is the dimension in which the coordinates of the vertices n-1 and n differ in the ternary reflected Gray code. - Arie Bos, Jul 12 2023
The number of powers of 3 that divide n. - Amiram Eldar, Mar 29 2025

Examples

			3^2 | 3*6 = 18, so a(6) = 2.
		

References

  • Letter from Gary W. Adamson to N. J. A. Sloane concerning Prouhet-Thue-Morse sequence, Nov. 11, 1999.

Crossrefs

Cf. A007949.
Partial sums give A004128.
Cf. A254046.

Programs

  • Haskell
    a051064 = (+ 1) . length .
                      takeWhile (== 3) . dropWhile (== 2) . a027746_row
    -- Reinhard Zumkeller, May 23 2013
    
  • Maple
    seq(1+padic:-ordp(n,3), n=1..100); # Robert Israel, Aug 07 2014
  • Mathematica
    Nest[ Function[ l, {Flatten[(l /. {1 -> {1, 1, 2}, 2 -> {1, 1, 3}, 3 -> {1, 1, 4}, 4 -> {1, 1, 5}})]}], {1}, 5] (* Robert G. Wilson v, Mar 03 2005 *)
    Table[ IntegerExponent[3n, 3], {n, 1, 105}] (* Jean-François Alcover, Oct 10 2011 *)
  • PARI
    a(n)=if(n<1,0,1+valuation(n,3))
    
  • Python
    def A051064(n):
        c = 1
        a, b = divmod(n,3)
        while b == 0:
            a, b = divmod(a,3)
            c += 1
        return c # Chai Wah Wu, Apr 18 2022

Formula

a(n) = A007949(n) + 1 = A004128(n) - A004128(n-1).
Multiplicative with a(p^e) = e+1 if p = 3; 1 if p <> 3. - Vladeta Jovovic, Aug 24 2002
G.f.: Sum_{k>=0} x^3^k/(1-x^3^k). - Ralf Stephan, Apr 12 2002
Fixed point of the morphism: 1 -> 112; 2 -> 113; 3 -> 114; 4 -> 115; ...; starting from a(1) = 1. a(3n+1) = a(3n+2) = 1; a(3n) = 1 + a(n). - Philippe Deléham, Mar 29 2004
a(n) = (-1)*Sum_{d divides n} mu(3d)*tau(n/d). - Benoit Cloitre, Jun 21 2007
Dirichlet g.f.: zeta(s)/(1-1/3^s). - R. J. Mathar, Jun 13 2011
a(n) = (1/2)*(3 - A053735(n) + A053735(n-1)) for n >= 1. - Tom Edgar, Aug 06 2014
a(n) = A007949(3n). - Cyril Damamme, Aug 04 2015
a(2n) = a(n), a(2n-1) = A254046(n). - Cyril Damamme, Aug 04 2015
G.f. A(x) satisfies: A(x) = A(x^3) + x/(1 - x). - Ilya Gutkovskiy, May 03 2019
Asymptotic mean: lim_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 3/2. - Amiram Eldar, Sep 11 2020 [corrected by Vaclav Kotesovec, Jun 25 2024, see also A004128]
a(n) = tau(n)/(tau(3*n) - tau(n)), where tau(n) = A000005(n). - Peter Bala, Jan 06 2021
G.f.: Sum_{i>=1, j>=0} x^(i*3^j). - Seiichi Manyama, Mar 23 2025
Conjecture: a(n) = A007949(A000045(4*n)), all other 3-adic quadrisections A007949(A000045(.))=0. [Lengyel?]. - R. J. Mathar, Jun 28 2025

Extensions

More terms from James Sellers, Dec 11 1999
More terms from Vladeta Jovovic, Aug 24 2002

A007417 If k appears, 3k does not.

Original entry on oeis.org

1, 2, 4, 5, 7, 8, 9, 10, 11, 13, 14, 16, 17, 18, 19, 20, 22, 23, 25, 26, 28, 29, 31, 32, 34, 35, 36, 37, 38, 40, 41, 43, 44, 45, 46, 47, 49, 50, 52, 53, 55, 56, 58, 59, 61, 62, 63, 64, 65, 67, 68, 70, 71, 72, 73, 74, 76, 77, 79, 80, 81, 82, 83, 85, 86, 88, 89, 90, 91, 92, 94, 95, 97, 98, 99, 100
Offset: 1

Views

Author

Keywords

Comments

The characteristic function of this sequence is given by A014578. - Philippe Deléham, Mar 21 2004
Numbers whose ternary representation ends in even number of zeros. - Philippe Deléham, Mar 25 2004
Numbers for which 3 is not an infinitary divisor. - Vladimir Shevelev, Mar 18 2013
Where odd terms occur in A051064. - Reinhard Zumkeller, May 23 2013

Examples

			From _Gary W. Adamson_, Mar 02 2010: (Start)
Given the following multiplication table: top row = "not multiples of 3", left column = powers of 3; we get:
   1   2   4   5   7   8   10   11   13
   3   6  12  15  21  24   30   33   39
   9  18  36  45  63  72   90   99  114
  27  54 108
  81
If rows are labeled (1, 2, 3, ...) then odd-indexed rows are in the set; but evens not. Examples: 9 is in the set since 3 is not, but 27 in row 4 can't be. (End)
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Complement of A145204. - Reinhard Zumkeller, Oct 04 2008
Cf. A007949, A014578 (characteristic function), A042948, A051064, A052330, A092400, A092401.

Programs

  • Haskell
    import Data.List (delete)
    a007417 n = a007417_list !! (n-1)
    a007417_list = s [1..] where
       s (x:xs) = x : s (delete (3*x) xs)
    
  • Mathematica
    Select[ Range[100], (# // IntegerDigits[#, 3]& // Split // Last // Count[#, 0]& // EvenQ)&] (* Jean-François Alcover, Mar 01 2013, after Philippe Deléham *)
    Select[Range[100], EvenQ@ IntegerExponent[#, 3] &] (* Michael De Vlieger, Sep 01 2020 *)
  • PARI
    is(n) = { my(i = 0); while(n%3==0, n/=3; i++); i%2==0; } \\ Iain Fox, Nov 17 2017
    
  • PARI
    is(n)=valuation(n,3)%2==0; \\ Joerg Arndt, Aug 08 2020
    
  • Python
    from sympy import integer_log
    def A007417(n):
        def f(x): return n+x-sum(((m:=x//9**i)-2)//3+(m-1)//3+2 for i in range(integer_log(x,9)[0]+1))
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        return m # Chai Wah Wu, Feb 15 2025

Formula

Limit_{n->infinity} a(n)/n = 4/3. - Philippe Deléham, Mar 21 2004
Partial sums of A092400. Indices of even numbers in A007949. Indices of odd numbers in A051064. a(n) = A092401(2n-1). - Philippe Deléham, Mar 29 2004
{a(n)} = A052330({A042948(n)}), where {a(n)} denotes the set of integers in the sequence. - Peter Munn, Aug 31 2019

Extensions

More terms from Philippe Deléham, Mar 29 2004
Typo corrected by Philippe Deléham, Apr 15 2010

A036668 Hati numbers: of form 2^i*3^j*k, i+j even, (k,6)=1.

Original entry on oeis.org

1, 4, 5, 6, 7, 9, 11, 13, 16, 17, 19, 20, 23, 24, 25, 28, 29, 30, 31, 35, 36, 37, 41, 42, 43, 44, 45, 47, 49, 52, 53, 54, 55, 59, 61, 63, 64, 65, 66, 67, 68, 71, 73, 76, 77, 78, 79, 80, 81, 83, 85, 89, 91, 92, 95, 96, 97, 99, 100, 101, 102, 103, 107
Offset: 1

Views

Author

N. J. A. Sloane, Antreas P. Hatzipolakis (xpolakis(AT)hol.gr)

Keywords

Comments

If n appears then 2n and 3n do not. - Benoit Cloitre, Jun 13 2002
Closed under multiplication. Each term is a product of a unique subset of {6} U A050376 \ {2,3}. - Peter Munn, Sep 14 2019

Crossrefs

Cf. A003159, A007310, A014601, A036667, A050376, A052330, A325424 (complement), A325498 (first differences), A373136 (characteristic function).
Positions of 0's in A182582.
Subsequences: A084087, A339690, A352272, A352273.

Programs

  • Maple
    N:= 1000: # to get all terms up to N
    A:= {seq(2^i,i=0..ilog2(N))}:
    Ae,Ao:= selectremove(issqr,A):
    Be:= map(t -> seq(t*9^j, j=0 .. floor(log[9](N/t))),Ae):
    Bo:= map(t -> seq(t*3*9^j,j=0..floor(log[9](N/(3*t)))),Ao):
    B:= Be union Bo:
    C1:= map(t -> seq(t*(6*i+1),i=0..floor((N/t -1)/6)),B):
    C2:= map(t -> seq(t*(6*i+5),i=0..floor((N/t - 5)/6)),B):
    A036668:= C1 union C2; # Robert Israel, May 09 2014
  • Mathematica
    a = {1}; Do[AppendTo[a, NestWhile[# + 1 &, Last[a] + 1,
    Apply[Or, Map[MemberQ[a, #] &, Select[Flatten[{#/3, #/2}],
    IntegerQ]]] &]], {150}]; a  (* A036668 *)
    (* Peter J. C. Moses, Apr 23 2019 *)
  • PARI
    twos(n) = {local(r,m);r=0;m=n;while(m%2==0,m=m/2;r++);r}
    threes(n) = {local(r,m);r=0;m=n;while(m%3==0,m=m/3;r++);r}
    isA036668(n) = (twos(n)+threes(n))%2==0 \\ Michael B. Porter, Mar 16 2010
    
  • PARI
    is(n)=(valuation(n,2)+valuation(n,3))%2==0 \\ Charles R Greathouse IV, Sep 10 2015
    
  • PARI
    list(lim)=my(v=List(),N);for(n=0,logint(lim\=1,3),N=if(n%2,2*3^n,3^n); while(N<=lim, forstep(k=N,lim,[4*N,2*N], listput(v,k)); N<<=2)); Set(v) \\ Charles R Greathouse IV, Sep 10 2015
    
  • Python
    from itertools import count
    def A036668(n):
        def f(x):
            c = n+x
            for i in range(x.bit_length()+1):
                i2 = 1<x:
                        break
                    m = x//k
                    c -= (m-1)//6+(m-5)//6+2
            return c
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        return m # Chai Wah Wu, Jan 28 2025

Formula

a(n) = 12/7 * n + O(log^2 n). - Charles R Greathouse IV, Sep 10 2015
{a(n)} = A052330({A014601(n)}), where {a(n)} denotes the set of integers in the sequence. - Peter Munn, Sep 14 2019

Extensions

Offset changed by Chai Wah Wu, Jan 28 2025

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

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

A014578 Binary expansion of Thue constant (or Roth's constant).

Original entry on oeis.org

0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1
Offset: 0

Keywords

Comments

a(0)=0; to construct the sequence start with a(1)=1, then concatenate twice and change the last term 1->0 giving 1,1,0. Concatenate those 3 terms twice giving 1,1,0,1,1,0,1,1,0, change the last term 0->1 giving 1,1,0,1,1,0,1,1,1. Concatenate those 9 terms twice and change the last term 1->0, etc. - Benoit Cloitre, Feb 09 2003
It is probably my fault if this constant is misattributed. It was "computed" circa 1971 by a very simple Life pattern (as a diagonal row of blinkers), an obvious case of the (Thue-Siegel-)Roth criterion for transcendence, since the error after 3^n bits is ~2^-3^(n+1) = O(denominator^-3). I probably should have called it Roth's constant. - Bill Gosper, Mar 19 2004
a(0) = 0; then fixed point of the morphism 1->110, 0->111, starting with a(1) = 1. - Philippe Deléham, Mar 21 2004
Characteristic function of A007417, i.e., a(n) = 1 if n is in A007417 and a(n) = 0 otherwise. - Philippe Deléham, Mar 21 2004
Multiplicative with a(3^e) = (e+1)%2, a(p^e) = 1 otherwise. - David W. Wilson, Jun 10 2005
a(A145204(n)) = 0, a(A007417(n)) = 1. - Reinhard Zumkeller, Oct 04 2008
1 if the ternary representation of n has an even number of trailing zeros. - Ralf Stephan, Sep 02 2013

Examples

			Start: 1
Rules:
  1 --> 110
  0 --> 111
-------------
0:   (#=1)
  1
1:   (#=3)
  110
2:   (#=9)
  110110111
3:   (#=27)
  110110111110110111110110110
4:   (#=81)
  110110111110110111110110110110110111110110111110110110110110111110110111110110111
- _Joerg Arndt_, Jul 06 2011
		

Crossrefs

Cf. Thue-Morse or parity constant A010060.
Cf. A154271.

Programs

  • Mathematica
    Nest[ Flatten[ # /. {0 -> {1, 1, 1}, 1 -> {1, 1, 0}}] &, {0}, 6] (* Robert G. Wilson v, Mar 09 2005 *)
  • PARI
    a(n)=if(n<1,0,sum(k=0,ceil(log(n)/log(3)),(-1)^k*(floor(n/3^k)-floor((n-1)/3^k))));
    
  • PARI
    A014578(n) = if(!n,n,valuation(n, 3)%2==0); \\ Ralf Stephan, Sep 02 2013, edited for the term a(0)=0 - Antti Karttunen, May 28 2024
    
  • Python
    from sympy import multiplicity
    def A014578(n): return multiplicity(3,n)&1^1 if n else 0 # Chai Wah Wu, Jan 28 2025

Formula

a(0)=0; for n>=1, a(n)=sum(k>=0, (-1)^k*(floor(n/3^k)-floor((n-1)/3^k))). - Benoit Cloitre, Jun 03 2003
a(0)=0, a(3k)=1-a(k); a(3k+1)=a(3k+2)=1. - Benoit Cloitre, Mar 19 2004
Sum_{k=0..3^n} a(k) = A015518(n+1) = (-1)^n*A014983(n+1). - Philippe Deléham, Mar 31 2004
a(n) = 1 - A007949(n) mod 2 for n>0. - Reinhard Zumkeller, Oct 04 2008
Let T(x) be the g.f., then T(x) + T(x^3) = x/(1-x). - Joerg Arndt, May 11 2010
Asymptotic mean: lim_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 3/4. - Amiram Eldar, Jul 13 2020

A325424 Complement of A036668: numbers not of the form 2^i*3^j*k, i + j even, (k,6) = 1.

Original entry on oeis.org

2, 3, 8, 10, 12, 14, 15, 18, 21, 22, 26, 27, 32, 33, 34, 38, 39, 40, 46, 48, 50, 51, 56, 57, 58, 60, 62, 69, 70, 72, 74, 75, 82, 84, 86, 87, 88, 90, 93, 94, 98, 104, 105, 106, 108, 110, 111, 118, 122, 123, 126, 128, 129, 130, 132, 134, 135, 136, 141, 142
Offset: 1

Author

Clark Kimberling, Apr 26 2019

Keywords

Comments

These are the numbers 2x and 3x as x ranges through the numbers in A036668.
Numbers whose squarefree part is divisible by exactly one of {2, 3}. - Peter Munn, Aug 24 2020
The asymptotic density of this sequence is 5/12. - Amiram Eldar, Sep 20 2020

Crossrefs

Symmetric difference of: A003159 and A007417; A036554 and A145204\{0}.

Programs

  • Mathematica
    a = {1}; Do[AppendTo[a, NestWhile[# + 1 &, Last[a] + 1, Apply[Or,
    Map[MemberQ[a, #] &, Select[Flatten[{#/3, #/2}],
    IntegerQ]]] &]], {150}]; a     (* A036668 *)
    Complement[Range[Last[a]], a]  (* A325424 *)
    (* Peter J. C. Moses, Apr 23 2019 *)
  • Python
    from itertools import count
    def A325424(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            kmin = kmax >> 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x):
            c = n
            for i in range(x.bit_length()+1):
                i2 = 1<x:
                        break
                    m = x//k
                    c += (m-1)//6+(m-5)//6+2
            return c
        return bisection(f,n,n) # Chai Wah Wu, Jan 28 2025

Formula

(2 * {A036668}) union (3 * {A036668}). - Sean A. Irvine, May 19 2019

A334747 Let p be the smallest prime not dividing the squarefree part of n. Multiply n by p and divide by the product of all smaller primes.

Original entry on oeis.org

2, 3, 6, 8, 10, 5, 14, 12, 18, 15, 22, 24, 26, 21, 30, 32, 34, 27, 38, 40, 42, 33, 46, 20, 50, 39, 54, 56, 58, 7, 62, 48, 66, 51, 70, 72, 74, 57, 78, 60, 82, 35, 86, 88, 90, 69, 94, 96, 98, 75, 102, 104, 106, 45, 110, 84, 114, 87, 118, 120, 122, 93, 126, 128, 130, 55
Offset: 1

Author

Peter Munn, May 09 2020

Keywords

Comments

A bijection from the positive integers to the nonsquares, A000037.
A003159 (which has asymptotic density 2/3) lists index n such that a(n) = 2n. The sequence maps the terms of A003159 1:1 onto A036554, defining a bijection between them.
Similarly, bijections are defined from A007417 to A325424, from A325424 to A145204\{0}, and from the first in each of the following pairs to the nonsquare integers in the second: (A145204\{0}, A036668), (A036668, A007417), (A036554, A003159), (A332820, A332821), (A332821, A332822), (A332822, A332820). Note that many of these are between sets where membership depends on whether a number's squarefree part divides by 2 and/or 3.
Starting from 1, and iterating the sequence as a(1) = 2, a(2) = 3, a(3) = 6, a(6) = 5, a(5) = 10, etc., runs through the squarefree numbers in the order they appear in A019565. - Antti Karttunen, Jun 08 2020

Examples

			168 = 42*4 has squarefree part 42 (and square part 4). The smallest prime absent from 42 = 2*3*7 is 5 and the product of all smaller primes is 2*3 = 6. So a(168) = 168*5/6 = 140.
		

Crossrefs

Permutation of A000037.
Row 2, and therefore column 2, of A331590. Cf. A334748 (row 3).
A007913, A034386, A053669, A225546 are used in formulas defining the sequence.
The formula section details how the sequence maps the terms of A002110, A003961, A019565; and how f(a(n)) relates to f(n) for f = A008833, A048675, A267116; making use of A003986.
Subsequences: A016825 (odd bisection), A036554, A329575.
Bijections are defined that relate to A003159, A007417, A036668, A145204, A325424, A332820, A332821, A332822.
Cf. also binary trees A334860, A334866 and A334870 (a left inverse).

Programs

  • PARI
    a(n) = {my(c=core(n), m=n); forprime(p=2, , if(c % p, m*=p; break, m/=p)); m;} \\ Michel Marcus, May 22 2020

Formula

a(n) = n * m / A034386(m-1), where m = A053669(A007913(n)).
a(n) = A331590(2, n) = A225546(2 * A225546(n)).
a(A019565(n)) = A019565(n+1).
a(k * m^2) = a(k) * m^2.
a(A003961(n)) = 2 * A003961(n).
a(2 * A003961(n)) = A003961(a(n)).
a(A002110(n)) = prime(n+1).
A048675(a(n)) = A048675(n) + 1.
A008833(a(n)) = A008833(n).
A267116(a(n)) = A267116(n) OR 1, where OR denotes the bitwise operation A003986.
a(A003159(n)) = A036554(n) = 2 * A003159(n).
A334870(a(n)) = n. - Antti Karttunen, Jun 08 2020

A043555 Number of runs in base-3 representation of n.

Original entry on oeis.org

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

Keywords

Comments

Every positive integer occurs infinitely many times. See A297770 for a guide to related sequences.
Having a(0) = 1 (rather than a(0) = 0) is debatable, on the grounds that a(0) = 1 is determined by our culture, rather than the underlying mathematics. See my August 2020 comment in A145204. - Peter Munn, Jul 12 2024
From M. F. Hasler, Jul 13 2024: (Start)
The base-2 version has a(0) = 0, corresponding to the convention that 0 has zero digits, which is the more logical (but maybe less human) convention, such that, e.g., b^n is the least number with n+1 digits in base b (<=> b^n - 1 is the largest number with n digits), valid also for 0. Here and in A043556 (base 4) the convention is that 0 has one digit, '0'.
"Runs" means substrings of consecutive equal digits, here in the base-3 representation of the numbers. See Example for details. (End)

Examples

			From _M. F. Hasler_, Jul 13 2024: (Start)
Numbers n = 0, 1, 2, 3, 4, 5, ... are written '0', '1', '2', '10', '11', '12', ... in base 3. The first three have one single digit, so there is just 1 "run" (= subsequence of equal digits), whence a(0) = a(1) = a(2) = 1.
In '10' we have a "run" of '1's of length 1, followed by a run of '0's of length 1, so there are a(3) = 2 runs.
In '11' we have again one single run, here of 2 digits '1', whence a(4) = 1. (End)
		

Crossrefs

Cf. A005811 (in base 2), A043556 (in base 4), A145204, A297770, A297771 (number of distinct runs).
Cf. A033113.

Programs

  • Maple
    NRUNS := proc(L::list)
        local a,i;
        a := 1 ;
        for i from 2 to nops(L) do
            if op(i,L) <> op(i-1,L) then
                a := a+1 ;
            end if
        end do:
        a ;
    end proc:
    A043555 := proc(n)
        convert(n,base,3) ;
        NRUNS(%) ;
    end proc:
    seq(A043555(n),n=0..80) ; # R. J. Mathar, Jul 12 2024
    # second Maple program:
    a:= n-> `if`(n<3, 1, a(iquo(n, 3))+`if`(n mod 9 in {0, 4, 8}, 0, 1)):
    seq(a(n), n=0..89);  # Alois P. Heinz, Jul 13 2024
  • Mathematica
    b = 3; s[n_] := Length[Split[IntegerDigits[n, b]]];
    Table[s[n], {n, 1, 200}]
  • PARI
    a(n)=my(d=digits(n,3)); sum(i=2,#d,d[i]!=d[i-1])+1 \\ Charles R Greathouse IV, Jul 20 2014
    
  • Python
    from itertools import groupby
    from sympy.ntheory import digits
    def A043555(n): return len(list(groupby(digits(n,3)[1:]))) # Chai Wah Wu, Jul 13 2024

Extensions

Updated by Clark Kimberling, Feb 03 2018

A055041 Numbers of the form 3^(2i+1)*(3*j+1).

Original entry on oeis.org

3, 12, 21, 27, 30, 39, 48, 57, 66, 75, 84, 93, 102, 108, 111, 120, 129, 138, 147, 156, 165, 174, 183, 189, 192, 201, 210, 219, 228, 237, 243, 246, 255, 264, 270, 273, 282, 291, 300, 309, 318, 327, 336, 345, 351, 354, 363, 372, 381, 390, 399
Offset: 1

Author

N. J. A. Sloane, Jun 01 2000

Keywords

Comments

The numbers not of the form x^2+y^2+6z^2.
Numbers whose squarefree part is congruent to 3 modulo 9. Compare with A329575. - Peter Munn, May 17 2020
The asymptotic density of this sequence is 1/8. - Amiram Eldar, Mar 08 2021

Crossrefs

Intersection of A145204 and A189716.
Complement of A055040 with respect to A145204\{0}.
Complement of A055048 with respect to A189716.

Programs

  • Mathematica
    f[p_, e_] := (p^Mod[e, 2]); sqfpart[n_] := Times @@ f @@@ FactorInteger[n]; Select[Range[400], Mod[sqfpart[#], 9] == 3 &] (* Amiram Eldar, Mar 08 2021 *)
  • Python
    from sympy import integer_log
    def A055041(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            kmin = kmax >> 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return n+x-sum((x//9**i-1)//3+1 for i in range(integer_log(x,9)[0]+1))
        return bisection(f,n,n)*3 # Chai Wah Wu, Feb 14 2025

Formula

a(n) = A055047(n) * 3. - Peter Munn, May 17 2020
Showing 1-10 of 20 results. Next