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.

A054684 Numbers whose sum of digits is odd.

Original entry on oeis.org

1, 3, 5, 7, 9, 10, 12, 14, 16, 18, 21, 23, 25, 27, 29, 30, 32, 34, 36, 38, 41, 43, 45, 47, 49, 50, 52, 54, 56, 58, 61, 63, 65, 67, 69, 70, 72, 74, 76, 78, 81, 83, 85, 87, 89, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 111, 113, 115, 117, 119, 120, 122, 124, 126, 128, 131
Offset: 1

Views

Author

Odimar Fabeny, Apr 19 2000

Keywords

Comments

Union of A179083 and A179085; A179081(a(n)) = 1. - Reinhard Zumkeller, Jun 28 2010
Equivalently, integers with an odd number of odd digits. - Bernard Schott, Nov 06 2022

Examples

			1, 3, 5, 7, 9, 10(1), 12(3), 14(5), 16(7), 18(9), 21(3) and so on.
		

Crossrefs

Cf. A054683, A137233 (number of n-digits terms).
Cf. A356929 (even number of even digits).
A294601 (exactly one odd decimal digit) is a subsequence.

Programs

  • Maple
    [seq(`if`(convert(convert(2*n-1,base,10),`+`)::odd, 2*n-1, 2*n-2), n=1..501)];
  • Mathematica
    Select[Range[200],OddQ[Total[IntegerDigits[#]]]&] (* Harvey P. Dale, Nov 27 2021 *)
  • PARI
    is(n)=my(d=digits(n));sum(i=1,#d,d[i])%2 \\ Charles R Greathouse IV, Aug 09 2013
    
  • PARI
    isok(m) = sumdigits(m) % 2; \\ Michel Marcus, Nov 06 2022
    
  • PARI
    a(n) = n=2*(n-1); n + !(sumdigits(n)%2); \\ Kevin Ryde, Nov 07 2022
    
  • Python
    def ok(n): return sum(map(int, str(n)))&1
    print([k for k in range(132) if ok(k)]) # Michael S. Branicky, Nov 06 2022

Formula

a(n) = n * 2 - 1 for the first 5 numbers; a(n) = n * 2 for the second 5 numbers.
From Robert Israel, Jun 27 2017: (Start)
a(n) = 2*n-2 if floor((n-1)/5) is in the sequence, 2*n-1 if not.
G.f. g(x) satisfies g(x) = (1-x)*(1+x+x^2+x^3+x^4)^2*g(x^10)/x^9 + x^2*(2+x^4+3*x^5-x^9+3*x^10)/((1-x)*(1+x^5))^2.
(End)

Extensions

More terms from James Sellers, Apr 19 2000

A356929 Integers with an even number of even digits.

Original entry on oeis.org

1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 20, 22, 24, 26, 28, 31, 33, 35, 37, 39, 40, 42, 44, 46, 48, 51, 53, 55, 57, 59, 60, 62, 64, 66, 68, 71, 73, 75, 77, 79, 80, 82, 84, 86, 88, 91, 93, 95, 97, 99, 100, 102, 104, 106, 108, 111, 113, 115, 117, 119, 120, 122, 124, 126, 128, 131, 133, 135
Offset: 1

Views

Author

Bernard Schott, Sep 05 2022

Keywords

Comments

Inspired by Question 2 of Olympiade Mathématique Belge 2004, Finale MAXI (see link).
The number of n-digit integers with an even number of even digits is A137233(n).

Examples

			13 has zero even digit, so 13 is a term.
124 has two even digits, so 124 is a term.
3578 has one even digit, so 3578 is not a term.
		

Crossrefs

Cf. A137233.

Programs

  • Mathematica
    Select[Range[120], EvenQ[Count[IntegerDigits[#], ?EvenQ]] &] (* _Amiram Eldar, Sep 05 2022 *)
  • PARI
    isok(k) = (#select(x->(!(x % 2)), digits(k)) % 2) == 0; \\ Michel Marcus, Sep 06 2022
  • Python
    def ok(n): return sum(1 for d in str(n) if d in "02468")%2 == 0
    print([k for k in range(120) if ok(k)]) # Michael S. Branicky, Sep 05 2022
    

A346629 Number of n-digit positive integers that are the product of two integers ending with 2.

Original entry on oeis.org

1, 4, 45, 450, 4500, 45000, 450000, 4500000, 45000000, 450000000, 4500000000, 45000000000, 450000000000, 4500000000000, 45000000000000, 450000000000000, 4500000000000000, 45000000000000000, 450000000000000000, 4500000000000000000, 45000000000000000000, 450000000000000000000
Offset: 1

Views

Author

Stefano Spezia, Jul 25 2021

Keywords

Comments

a(n) is the number of n-digit numbers in A139245.
After initial 1 or 2 values the same as A137233. - R. J. Mathar, Aug 23 2021

Crossrefs

Cf. A011557 (powers of 10), A017293 (positive integers ending with 2), A052268 (number of n-digit integers), A139245 (product of two integers ending with 2), A093143, A337855, A337856.
Cf. A137233.

Programs

  • Mathematica
    LinearRecurrence[{10},{1,4,45},25]

Formula

O.g.f.: x*(1 - 6*x + 5*x^2)/(1 - 10*x).
E.g.f.: (9*exp(10*x) - 9 + 110*x - 50*x^2)/200.
a(n) = 10*a(n-1) for n > 3, with a(1) = 1, a(2) = 4 and a(3) = 45.
a(n) = 45*10^(n-3) for n > 2.
a(n) = 45*A011557(n-3) for n > 2.
Sum_{i=1..n} a(n) = A093143(n-1).

A358270 Numbers whose sum of digits is even and that have an even number of even digits.

Original entry on oeis.org

11, 13, 15, 17, 19, 20, 22, 24, 26, 28, 31, 33, 35, 37, 39, 40, 42, 44, 46, 48, 51, 53, 55, 57, 59, 60, 62, 64, 66, 68, 71, 73, 75, 77, 79, 80, 82, 84, 86, 88, 91, 93, 95, 97, 99, 1001, 1003, 1005, 1007, 1009, 1010, 1012, 1014, 1016, 1018, 1021, 1023, 1025, 1027, 1029, 1030
Offset: 1

Views

Author

Bernard Schott, Nov 06 2022

Keywords

Comments

There are only terms with an even number of digits, and precisely, there exist A137233(2*k) terms with 2*k digits.
The conditions separately are A054683 for even sum of digits, and A356929 for even number of even digits, so that this sequence is their intersection.
The opposite conditions, an odd sum of digits, and an odd number of odd digits, are the same and are A054684.

Examples

			26 is a term since 2+6 = 8 (even) and 26 has two even digits.
39 is a term since 3+9 = 12 (even) and 39 has zero even digits.
1012 is a term since 1+0+1+2 = 4 (even) and 1012 has two even digits.
		

Crossrefs

Intersection of A054683 and A356929.
Cf. A001637 (even length), A179081 (digit sum mod 2).

Programs

  • Mathematica
    Select[Range[1000], EvenQ[Plus @@ IntegerDigits[#]] && EvenQ[Plus @@ DigitCount[#, 10, Range[0, 8, 2]]] &] (* Amiram Eldar, Nov 06 2022 *)
  • PARI
    a(n) = n*=2; n += 100^logint(110*n,100) \ 11; n - sumdigits(n)%2; \\ Kevin Ryde, Nov 10 2022
  • Python
    def ok(n): s = str(n); return sum(map(int, s))%2 == sum(1 for d in s if d in "02468")%2 == 0
    print([k for k in range(1031) if ok(k)]) # Michael S. Branicky, Nov 06 2022
    
  • Python
    from itertools import count, islice, chain
    def A358270_gen(): # generator of terms
        return filter(lambda n:not (len(s:=str(n))&1 or sum(int(d) for d in s)&1), chain.from_iterable((range(10**l,10**(l+1)) for l in count(1,2))))
    A358270_list = list(islice(A358270_gen(),61)) # Chai Wah Wu, Nov 11 2022
    

Formula

a(n) = t - A179081(t) where t = A001637(2*n). - Kevin Ryde, Nov 10 2022
Showing 1-4 of 4 results.