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.

Previous Showing 21-30 of 54 results. Next

A171797 A modified Sisyphus function: a(n) = concatenation of (number of digits in n) (number of even digits) (number of odd digits).

Original entry on oeis.org

110, 101, 110, 101, 110, 101, 110, 101, 110, 101, 211, 202, 211, 202, 211, 202, 211, 202, 211, 202, 220, 211, 220, 211, 220, 211, 220, 211, 220, 211, 211, 202, 211, 202, 211, 202, 211, 202, 211, 202, 220, 211, 220, 211, 220, 211, 220, 211, 220, 211, 211, 202
Offset: 0

Views

Author

N. J. A. Sloane, Oct 15 2010

Keywords

Comments

Start with n, repeatedly apply the map i -> a(i). Then every number converges to 312. - Eric Angelini and Alexandre Wajnberg, Oct 15 2010

Examples

			11 has 2 digits, both odd, so a(11) = 202.
12 has 2 digits, one even and one odd, so a(12)=211. Then a(211) = 312.
		

References

  • M. E. Coppenbarger, Iterations of a modified Sisyphus function, Fib. Q., 56 (No. 2, 2018), 130-141.

Crossrefs

Cf. A073053 (Sisyphus), A171798, A171813, A055642, A196563, A196564, A308002, A308003 (another version).
A100961 gives steps to reach 312.

Programs

  • Haskell
    a171797 n = read $ concatMap (show . ($ n))
                       [a055642, a196563, a196564] :: Integer
    -- Reinhard Zumkeller, Feb 22 2012, Oct 15 2010
    
  • Maple
    nevenDgs := proc(n) local a, d; a := 0 ; for d in convert(n,base,10) do if type(d,'even') then a :=a +1 ; end if; end do; a ; end proc:
    cat2 := proc(a,b) local ndigsb; ndigsb := max(ilog10(b)+1,1) ; a*10^ndigsb+b ; end:
    catL := proc(L) local a, i; a := op(1,L) ; for i from 2 to nops(L) do a := cat2(a,op(i,L)) ; end do; a; end proc:
    A055642 := proc(n) max(1,ilog10(n)+1) ; end proc:
    A171797 := proc(n) local n1,n2 ; n1 := A055642(n) ; n2 := nevenDgs(n) ; catL([n1,n2,n1-n2]) ; end proc:
    seq(A171797(n),n=1..80) ; # R. J. Mathar, Oct 15 2010 and Oct 18 2010
  • Python
    def a(n):
        s = str(n); e = sum(d in "02468" for d in s)
        return int("".join(map(str, (len(s), e, len(s)-e))))
    print([a(n) for n in range(52)]) # Michael S. Branicky, Jun 15 2021

Extensions

More terms from R. J. Mathar, Oct 15 2010
a(0) added by N. J. A. Sloane, May 12 2019

A102679 Number of digits >= 7 in decimal representation of n.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Feb 03 2005

Keywords

Comments

a(n) = 0 iff n is in A007093 (numbers in base 7). - Bernard Schott, Feb 12 2023

Crossrefs

Programs

  • Maple
    p:=proc(n) local b,ct,j: b:=convert(n,base,10): ct:=0: for j from 1 to nops(b) do if b[j]>=7 then ct:=ct+1 else ct:=ct fi od: ct: end: seq(p(n),n=0..125); # Emeric Deutsch, Feb 23 2005

Formula

From Hieronymus Fischer, Jun 10 2012: (Start)
a(n) = Sum_{j=1..m+1} (floor(n/10^j + 3/10) - floor(n/10^j)), where m = floor(log_10(n)).
G.f.: g(x) = (1/(1-x))*Sum_{j>=0} (x^(7*10^j) - x^(10*10^j))/(1 - x^10^(j+1)). (End)

Extensions

More terms from Emeric Deutsch, Feb 23 2005

A104639 Number of even digits in n^3.

Original entry on oeis.org

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

Views

Author

Zak Seidov, Mar 18 2005

Keywords

Crossrefs

Programs

Formula

a(n) = A196563(n^3). - Michel Marcus, Oct 05 2013

A065031 In the decimal expansion of n, replace each odd digit with 1 and each even digit with 2.

Original entry on oeis.org

2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 12, 11, 12, 11, 12, 11, 12, 11, 12, 11, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 12, 11, 12, 11, 12, 11, 12, 11, 12, 11, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21, 12, 11, 12, 11, 12, 11, 12, 11, 12, 11, 22, 21, 22, 21, 22, 21, 22, 21, 22, 21
Offset: 0

Views

Author

Santi Spadaro, Nov 03 2001

Keywords

Comments

A196563(a(n)) = A196563(n); A196564(a(n)) = A196564(n).

Examples

			a(123)=121 because 1 and 3 are odd and 2 is even.
		

Programs

  • Haskell
    a065031 n = f n  where
       f x | x < 10    = 2 - x `mod` 2
           | otherwise = 10 * (f x') + 2 - m `mod` 2
           where (x',m) = divMod x 10
    -- Reinhard Zumkeller, Feb 22 2012
  • Mathematica
    Table[FromDigits[If[OddQ[#],1,2]&/@IntegerDigits[n]],{n,0,120}] (* Harvey P. Dale, Jun 08 2014 *)

A102681 Number of digits >= 8 in decimal representation of n.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Feb 03 2005

Keywords

Comments

a(n) = 0 iff n is in A007094 (numbers in base 8). - Bernard Schott, Feb 18 2023

Crossrefs

Programs

  • Maple
    p:=proc(n) local b,ct,j: b:=convert(n,base,10): ct:=0: for j from 1 to nops(b) do if b[j]>=8 then ct:=ct+1 else ct:=ct fi od: ct: end: seq(p(n),n=0..120); # Emeric Deutsch, Feb 23 2005

Formula

From Hieronymus Fischer, Jun 10 2012: (Start)
a(n) = Sum_{j=1..m+1} (floor(n/10^j + 1/5) - floor(n/10^j)), where m = floor(log_10(n)).
G.f.: g(x) = (1/(1-x))*Sum_{j>=0} (x^(8*10^j) - x^(10*10^j))/(1 - x^10^(j+1)). (End)

Extensions

More terms from Emeric Deutsch, Feb 23 2005

A338742 When a(n) is even, a(n) is the number of even digits present so far in the sequence, a(n) included.

Original entry on oeis.org

1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 2, 23, 4, 25, 6, 27, 8, 29, 10, 31, 33, 35, 37, 39, 41, 12, 43, 14, 45, 16, 47, 18, 20, 22, 24, 26, 28, 49, 30, 51, 53, 55, 57, 59, 61, 32, 63, 34, 65, 36, 67, 38, 40, 42, 44, 46, 48, 69, 50, 71, 73, 75, 77, 79, 81, 52, 83, 54, 85, 56, 87, 58, 60, 62, 64, 66, 68, 89
Offset: 1

Views

Author

Eric Angelini and Carole Dubois, Nov 06 2020

Keywords

Comments

The odd nonnegative integers are present in their natural order. Some even natural integers will never appear.

Examples

			The first even term is a(12) = 2 and there are indeed 2 even digits so far in the sequence (the 2 from 21 and 2 itself);
The next even term is a(14) = 4 and there are now 4 even digits so far (2, 2, 2 and 4);
The next even term is a(16) = 6 and there are now 6 even digits so far (2, 2, 2, 4, 2 and 6); etc.
		

Crossrefs

Cf. A338741, A338743, A338744, A338745, A338746 (variants on the same idea), A196563.

Programs

  • Mathematica
    Block[{a = {0}, c = 0}, Do[Block[{k = 1, s}, While[If[EvenQ[k], Nand[FreeQ[a, k], k == c + Set[s, Total@ DigitCount[k, 10, {0, 2, 4, 6, 8}]]], ! FreeQ[a, k]], k++]; If[EvenQ[k], c += s, c += Total@ DigitCount[k, 10, {0, 2, 4, 6, 8}]]; AppendTo[a, k]], {i, 79}]; a] (* Michael De Vlieger, Nov 06 2020 *)

A338743 When a(n) is odd, a(n) is the number of even digits present so far in the sequence, a(n) included.

Original entry on oeis.org

0, 1, 2, 4, 3, 6, 8, 5, 10, 12, 7, 14, 16, 9, 18, 20, 22, 24, 26, 28, 21, 30, 23, 32, 25, 34, 27, 36, 29, 38, 40, 42, 44, 46, 48, 41, 50, 43, 52, 45, 54, 47, 56, 49, 58, 60, 62, 64, 66, 68, 61, 70, 63, 72, 65, 74, 67, 76, 69, 78, 80, 82, 84, 86, 88, 81, 90, 83, 92, 85, 94, 87, 96, 89, 98, 100, 102, 104
Offset: 1

Views

Author

Eric Angelini and Carole Dubois, Nov 06 2020

Keywords

Comments

The even nonnegative integers are present in their natural order. Some odd natural integers will never appear (11 for instance).

Examples

			The first odd term is a(2) = 1 and there is indeed 1 even digit so far in the sequence (0);
The next odd term is a(5) = 3 and there are now 3 even digits so far (0, 2 and 4);
The next odd term is a(8) = 5 and there are now 5 even digits so far (0, 2, 4, 6 and 8);
...
The term a(21) = 21 and there are indeed 21 even digits in the sequence so far (0, 2, 4, 6, 8, 0, 2, 4, 6, 8, 2, 0, 2, 2, 2, 4, 2, 6, 2, 8, 2); etc.
		

Crossrefs

Cf. A338741, A338742, A338744, A338745, A338746 (variants on the same idea), A196563.

Programs

  • Mathematica
    Block[{a = {0}, c = 1}, Do[Block[{k = 1, s}, While[If[OddQ[k], Nand[FreeQ[a, k], k == c + Set[s, Total@DigitCount[k, 10, {0, 2, 4, 6, 8}]]], ! FreeQ[a, k]], k++]; If[OddQ[k], c += s, c += Total@ DigitCount[k, 10, {0, 2, 4, 6, 8}]]; AppendTo[a, k]], {i, 77}]; a] (* Michael De Vlieger, Nov 06 2020 *)

A102677 Number of digits >= 6 in decimal representation of n.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Feb 03 2005

Keywords

Comments

a(n) = 0 iff n is in A007092 (numbers in base 6). - Bernard Schott, Feb 02 2023

Crossrefs

Programs

  • Maple
    p:=proc(n) local b,ct,j: b:=convert(n,base,10): ct:=0: for j from 1 to nops(b) do if b[j]>=6 then ct:=ct+1 else ct:=ct fi od: ct: end: seq(p(n),n=0..116); # Emeric Deutsch, Feb 23 2005
  • Mathematica
    Table[Total@ Take[Most@ DigitCount@ n, -4], {n, 0, 104}] (* Michael De Vlieger, Aug 17 2017 *)

Formula

From Hieronymus Fischer, Jun 10 2012: (Start)
a(n) = Sum_{j=1..m+1} (floor(n/10^j + 2/5) - floor(n/10^j)), where m = floor(log_10(n)).
G.f.: g(x) = (1/(1-x))*Sum_{j>=0} (x^(6*10^j) - x^(10*10^j))/(1-x^10^(j+1)). (End)

Extensions

More terms from Emeric Deutsch, Feb 23 2005

A352547 Numbers having more odd than even digits when written in base 10.

Original entry on oeis.org

1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 31, 33, 35, 37, 39, 51, 53, 55, 57, 59, 71, 73, 75, 77, 79, 91, 93, 95, 97, 99, 101, 103, 105, 107, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 121, 123, 125, 127, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 141, 143, 145, 147, 149, 150, 151, 152, 153, 154, 155
Offset: 1

Views

Author

M. F. Hasler, Jul 03 2022

Keywords

Crossrefs

Cf. A072600 (same in base 2).
Cf. A227870, A352546 (numbers with fewer odd than even decimal digits).

Programs

  • Mathematica
    A352547Q[k_] := Length[#] < 2*Count[#, _?OddQ] &[IntegerDigits[k]];
    Select[Range[300], A352547Q] (* Paolo Xausa, Nov 28 2024 *)
  • PARI
    select( {is_A352547(n)=vecsum(n=digits(n)%2)*2>#n}, [0..155])
    
  • Python
    def ok(n): return len(s:=str(n)) > 2*sum(1 for c in s if c in "02468")
    print([k for k in range(156) if ok(k)]) # Michael S. Branicky, Jul 03 2022

A007928 Numbers containing an even digit.

Original entry on oeis.org

0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32, 34, 36, 38, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 52, 54, 56, 58, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 72, 74, 76, 78, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 92, 94, 96, 98, 100
Offset: 1

Views

Author

R. Muller

Keywords

Comments

Or, numbers whose product of digits is even.
Complement of A014261; A196563(a(n)) > 0. - Reinhard Zumkeller, Oct 04 2011

Programs

  • Haskell
    import Data.List (findIndices)
    a007928 n = a007928_list !! (n-1)
    a007928_list = findIndices (> 0) a196563_list
    -- Reinhard Zumkeller, Oct 04 2011
    
  • Magma
    [ n : n in [0..129] | IsEven(&*Intseq(n,10)) ];
    
  • PARI
    is(n)=vecmin(Set(digits(n)%2))==0 \\ Charles R Greathouse IV, Feb 14 2017

Formula

a(n) ~ n. - Charles R Greathouse IV, Sep 07 2012
Previous Showing 21-30 of 54 results. Next