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

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

Original entry on oeis.org

0, 1, 2, 4, 6, 8, 10, 3, 12, 5, 14, 7, 16, 9, 11, 13, 15, 17, 18, 20, 22, 24, 26, 28, 30, 32, 21, 34, 23, 36, 25, 38, 27, 40, 42, 44, 46, 48, 50, 29, 31, 33, 35, 37, 39, 52, 41, 54, 43, 56, 45, 58, 47, 60, 62, 64, 66, 68, 70, 49, 51, 53, 55, 57, 59, 72, 61, 74, 63, 76, 65, 78, 67, 80, 82, 84, 86, 88, 90, 69
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 (19 for instance).

Examples

			The first odd term is a(2) = 1 and there is indeed 1 odd digit so far in the sequence (1 itself);
The next odd term is a(8) = 3 and there are now 3 odd digits so far (1, 1 and 3);
The next odd term is a(10) = 5 and there are now 5 odd digits so far (1, 1, 3, 1 and 5);
...
The next odd term is a(18) = 17 and there are indeed 17 odd digits so far in the sequence (1, 1, 3, 1, 5, 1, 7, 1, 9, 1, 1, 1, 3, 1, 5, 1, 7); etc.
		

Crossrefs

Cf. A338742, A338743, A338744, A338745, A338746 (variants on the same idea), A196564.

Programs

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

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 *)

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

Original entry on oeis.org

0, 1, 3, 2, 5, 7, 4, 9, 11, 13, 10, 15, 17, 19, 21, 18, 23, 25, 20, 27, 29, 22, 31, 24, 33, 26, 35, 28, 37, 39, 41, 34, 43, 36, 45, 38, 47, 49, 40, 51, 42, 53, 44, 55, 46, 57, 48, 59, 61, 52, 63, 54, 65, 56, 67, 58, 69, 71, 73, 75, 77, 79, 70, 81, 72, 83, 74, 85, 76, 87, 78, 89, 91, 93, 95, 97, 99, 90, 101
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 (6 for instance).

Examples

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

Crossrefs

Cf. A338741, A338742, A338743, A338745, A338746 (variants on the same idea), A196564.

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, {1, 3, 5, 7, 9}]]], ! FreeQ[a, k]], k++]; If[EvenQ[k], c += s, c += Total@ DigitCount[k, 10, {1, 3, 5, 7, 9}]]; AppendTo[a, k]], {i, 78}]; a] (* Michael De Vlieger, Nov 06 2020 *)

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

Original entry on oeis.org

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

Views

Author

Eric Angelini and Carole Dubois, Nov 07 2020

Keywords

Comments

The prime digits are 2, 3, 5 and 7. The prime numbers appear in their natural order in the sequence [except for the switch a(2)<->a(3)]. Some nonprimes will never appear (12 for instance).

Examples

			The first even term is a(3) = 2 and there are indeed 2 prime digits so far in the sequence (3 and 2 itself);
The next even term is a(6) = 4 and there are now 4 prime digits so far (3, 2, 5 and 7);
The next even term is a(11) = 6 and there are now 6 prime digits so far (3, 2, 5, 7, 3 and 5); etc.
		

Crossrefs

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

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

Original entry on oeis.org

2, 1, 4, 6, 8, 10, 12, 3, 14, 16, 18, 20, 5, 22, 24, 26, 9, 28, 30, 11, 32, 34, 15, 36, 17, 38, 40, 42, 19, 44, 46, 48, 50, 21, 23, 25, 27, 52, 54, 31, 33, 35, 37, 56, 39, 58, 60, 62, 41, 64, 66, 68, 70, 43, 72, 74, 47, 76, 78, 49, 80, 82, 51, 53, 55, 57, 84, 86, 88, 90, 92, 59, 94, 96, 98, 100, 102
Offset: 1

Views

Author

Eric Angelini and Carole Dubois, Nov 07 2020

Keywords

Examples

			The first odd term is a(2) = 1 and there is indeed 1 prime digit so far in the sequence (this is the 2 before 1);
The next odd term is a(8) = 3 and there are now 3 prime digits so far (2, 2 and 3);
The next odd term is a(13) = 5 and there are now 5 prime digits so far (2, 2, 3, 2 and 5); etc.
		

Crossrefs

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

A340015 a(n) is the least even number not used earlier and equal to the sum of the odd digits of the terms up to and including a(n), if such a number exists; otherwise, a(n) is the least odd number not occurring earlier.

Original entry on oeis.org

0, 1, 3, 4, 5, 10, 7, 18, 9, 30, 11, 13, 15, 42, 17, 19, 60, 21, 23, 64, 25, 76, 27, 92, 29, 102, 31, 33, 114, 116, 118, 35, 130, 134, 138, 37, 154, 39, 174, 41, 43, 45, 184, 194, 47, 49, 51, 53, 224, 55, 57, 246, 59, 260, 61, 63, 264, 65, 276, 67, 292, 69, 304, 71, 316, 73, 332, 338, 75, 358, 77, 79, 81, 83, 85, 87, 404, 89, 414, 91
Offset: 0

Views

Author

Eric Angelini and Carole Dubois, Dec 26 2020

Keywords

Comments

From M. F. Hasler, Dec 06 2022: (Start)
From the definition it is immediate that any even term is equal to the sum of all odd digits in the sequence up to that term.
Also, the subsequences of terms of given parity are both strictly increasing: The odd terms give exactly the sequence of all odd numbers, A005408, and any even number not occurring before a given even a(n) (e.g., 2, 6, 8, 12, 14, 16, ...) will never occur in the sequence.
The search space to check whether an even number can extend the sequence is bounded because using a number with more digits can increase the sum of digits by at most 9 per digit, while the number itself becomes (roughly) 10 times larger with each additional digit.
We have the following properties:
1) If the sum of all odd digits up to a(n) has only even digits, then a(n+1) equals that sum.
2) An even term a(n) can never be immediately followed by a term a(n+1) with only even digits.
3) An even term a(n) can be followed by another even term a(n+1) if the sum of the odd digits of a(n+1) is equal to a(n+1) - a(n), as for example at (..., 114, 116, 118, ...) and (..., 130, 134, 138, ...).
4) If a(n) is even and s = (sum of the odd digits of a(n)) can be added to a(n) without changing any of a(n)'s odd digits and leaving a(n)'s even digits even, then a(n+1) <= a(n) + s. (There may be a smaller solution a(n+1) whose sum of odd digits is smaller than s.) (End)

Examples

			The 1st nonzero even term is 4 and 4 is the sum of the odd digits so far, 1 and 3;
The 2nd even term is 10 and 10 is the sum of 1+3+5+1 (the last 1 being the 1 of 10 itself);
The 3rd even term is 18 and 10 is the sum of 1+3+5+1+7+1 (the last 1 being the 1 of 18 itself);
The 4th even term is 30 and 30 is the sum of 1+3+5+1+7+1+9+3 (the last 3 being the 3 of 30 itself); etc.
		

Crossrefs

Cf. A005408 (odd numbers), A071649 (sum of odd decimal digits of n).

Programs

  • Python
    def A357051_first(N=100):
        S = []; used_even = set(); next_odd = 1; sod = 0 # sum of odd digits (so far)
        for n in range(N):
            x = sod + sod % 2; lim = sod + 9*len(str(x)); sodx = A071649(x)
            while x < lim:
                if x == sod + sodx and x not in used_even:
                    used_even |= { x } ; break
                x += 2
                if x % 10 == 0:
                    sodx = A071649(x)
                    if sodx == 1: lim += 9
            else: x = next_odd; next_odd += 2; sodx = A071649(x)
            S += [ x ] ; sod += sodx
        return S
    # M. F. Hasler, Dec 06 2022
Showing 1-6 of 6 results.