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.

A359248 a(n) is the first number that is the start of a string of exactly n consecutive numbers in A358350.

Original entry on oeis.org

3, 11, 42, 32, 20, 154, 130, 1240, 515, 1033, 610, 3101, 103, 4010, 56379, 31809, 35212, 23103, 7413, 12101, 1011, 204, 10391, 92109, 25013, 812819, 75099, 8493016, 437016, 775009, 287017, 8029, 457014, 10503, 26148108, 10997, 27445016, 286092, 231135007, 480014
Offset: 1

Views

Author

Robert Israel, Dec 22 2022

Keywords

Comments

a(n) is the least k such that k, k+1, ..., k+n-1 are in A358350 but k-1 and k+n are not.

Examples

			a(3) = 42 because the three consecutive numbers 42, 43 and 44 are in A358350 but 41 and 45 are not, and this is the first string of exactly three consecutive numbers in A358350.
		

Crossrefs

Cf. A358350.

Programs

  • Maple
    f:= proc(n) local L; L:= convert(n,base,10); n + convert(L,`+`)+convert(L,`*`) end proc:
    S:= select(`<=`,map(f,{$1..10^6}),10^6):
    S:= sort(convert(S,list)):
    V:= Vector(27):
    a:= 1:
    for x from 2 to nops(S) do
      if S[x] - S[x-1] > 1 then
        v:= x-a;
        if v <= 27 and V[v] = 0 then V[v]:= S[a]; count:= count+1; fi;
        a:= x;
      fi
    od:
    convert(V,list);
  • Python
    from math import prod
    from itertools import islice
    def sp(n): d = list(map(int, str(n))); return sum(d) + prod(d)
    def agen(increment=10**6):
        S, L, U, adict, rl, n = set(), 1, increment, dict(), 0, 1
        while True:
            S |= set(i + sp(i) for i in range(L, U))
            for i in range(L, U):
                if i in S: rl += 1
                else:
                    if rl not in adict:
                        adict[rl] = i - rl
                        while n in adict: yield adict[n]; n += 1
                    rl = 0
            S -= set(range(L, U))
            L, U = U, U + increment
    print(list(islice(agen(), 34))) # Michael S. Branicky, Dec 23 2022

Extensions

a(28)-a(40) from Michael S. Branicky, Dec 22 2022

A358351 Number of values of m such that m + (sum of digits of m) + (product of digits of m) is n.

Original entry on oeis.org

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

Views

Author

Bernard Schott, Nov 16 2022

Keywords

Comments

a(n) is the number of times n occurs in A161351.
a(n) > 0 iff n is in A358350.

Examples

			A161351(15) = 15 + (1+5) + (1*5) = 26 =  21 + (2+1) + (2*1) = A161351(21), so, a(26) = 2.
		

Crossrefs

Similar: A230093 (m+digitsum), A230103 (m+digitprod).

Programs

  • Mathematica
    f[n_] := n + Total[(d = IntegerDigits[n])] + Times @@ d; With[{m = 100}, BinCounts[Table[f[n], {n, 1, m}], {1, m, 1}]] (* Amiram Eldar, Nov 16 2022 *)
  • PARI
    first(n) = {my(res = vector(n)); for(i = 1, n, c = i + sumdigits(i) + vecprod(digits(i)); if(c <= n, res[c]++ ) ); res } \\ David A. Corneth, Nov 16 2022
    
  • Python
    from itertools import combinations_with_replacement
    from math import prod
    def A358351(n):
        c = set()
        for l in range(1,len(str(n))+1):
            l1, l2 = 10**l, 10**(l-1)
            for d in combinations_with_replacement(tuple(range(10)),l):
                s, p = sum(d), prod(d)
                if l1>(m:=n-s-p)>=l2 and sorted(int(d) for d in str(m)) == list(d):
                    c.add(m)
        return len(c) # Chai Wah Wu, Nov 20 2022

A358352 a(n) is the smallest number k such that A358351(k) = n.

Original entry on oeis.org

1, 3, 26, 38, 380, 1116, 12912, 95131, 342038, 3320210, 494204209, 773089018
Offset: 0

Views

Author

Bernard Schott, Nov 19 2022

Keywords

Examples

			19+sod(19)+pod(19) = 24+sod(24)+pod(24) = 31+sod(31)+pod(31) = 38, and there is no integer < 38 for which function A161351 has 3 preimages, so a(3) = 38.
		

Crossrefs

Programs

  • C
    See Links section.
  • Mathematica
    f[n_] := n + Total[(d = IntegerDigits[n])] + Times @@ d; s = With[{m = 10^7}, BinCounts[Table[f[n], {n, 1, m}], {1, m, 1}]]; FirstPosition[s, #] & /@ Range[0, Max[s]] // Flatten (* Amiram Eldar, Nov 19 2022 *)
  • PARI
    first(n) = my(res = vector(n)); for(i = 1, n, c = i + sumdigits(i) + vecprod(digits(i)); if(c <= n, res[c]++ ) ); res; \\ A358351
    lista(nn) = my(v=first(nn)); for (n=0, 20, my(vs = select(x->(x==n), v, 1)); if (#vs, print1(vs[1], ", "), break);); \\ Michel Marcus, Nov 20 2022
    

Extensions

a(4)-a(5) from Michel Marcus, Nov 19 2022
a(6)-a(9) from Amiram Eldar, Nov 19 2022
a(10)-a(11) from Rémy Sigrist, Nov 20 2022

A358353 Numbers that are not of the form m + (sum of digits of m) + (product of digits of m) for any m.

Original entry on oeis.org

1, 2, 4, 5, 7, 8, 10, 13, 16, 19, 25, 28, 31, 36, 37, 39, 40, 41, 45, 47, 49, 51, 52, 57, 59, 60, 61, 64, 65, 67, 70, 71, 72, 75, 79, 81, 84, 85, 87, 89, 91, 93, 94, 96, 100, 102, 116, 120, 125, 126, 129, 137, 141, 142, 146, 150, 152, 153, 160, 161, 162, 166, 171, 172, 173, 180
Offset: 1

Views

Author

Bernard Schott, Dec 19 2022

Keywords

Comments

Numbers missing from A358350.
The first differences show some periodicity, for example those for values 2184-3811 repeat at terms 5513-7140. - Bill McEachen, Jan 08 2023

Examples

			There is no term du_10 < 36 such that du + (d+u) + (d*u) = 36, so 36 is a term.
		

Crossrefs

Similar: A003052 (m+digitsum), A230104 (m+digitprod).

Programs

  • Maple
    f:= proc(n) local L; L:= convert(n,base,10); n + convert(L,`+`)+convert(L,`*`) end proc:
    sort(convert({$1..200} minus map(f, {$1..200}),list)); # Robert Israel, Dec 22 2022
  • Mathematica
    f[n_] := n + Total[(d = IntegerDigits[n])] + Times @@ d; With[{m = 180}, Complement[Range[m], Table[f[n], {n, 1, m}]]] (* Amiram Eldar, Dec 19 2022 *)
  • PARI
    f(n) = my(d=digits(n)); vecsum(d)+vecprod(d)+n; \\ A161351
    isok(m) = for(i=1, m, if (f(i) == m, return(0))); return(1); \\ Michel Marcus, Jan 09 2023
  • Python
    from math import prod
    def sp(n): d = list(map(int, str(n))); return sum(d) + prod(d)
    def ok(n): return all(m + sp(m) != n for m in range(n+1))
    print([k for k in range(181) if ok(k)]) # Michael S. Branicky, Dec 19 2022
    
Showing 1-4 of 4 results.