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 11-16 of 16 results.

A285093 Corresponding values of arithmetic means of digits of numbers from A061383.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 2, 3, 4, 5, 6, 2, 3, 4, 5, 6, 3, 4, 5, 6, 7, 3, 4, 5, 6, 7, 4, 5, 6, 7, 8, 4, 5, 6, 7, 8, 5, 6, 7, 8, 9, 1, 2, 3, 1, 2, 3, 1, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 5, 3, 4, 5, 3, 4, 5, 3, 4, 5, 6, 4, 5, 6
Offset: 0

Views

Author

Jaroslav Krizek, Apr 14 2017

Keywords

Crossrefs

Cf. A061383 (numbers with integer arithmetic mean of digits in base 10).
Sequences of numbers n such that a(n) = k for k = 1 - 9: A061384 (k = 1), A061385 (k = 2), A061386 (k = 3), A061387 (k = 4), A061388 (k = 5), A061423 (k = 6), A061424 (k = 7), A061425 (k = 8), A002283 (k = 9).
Cf. A004426, A004427, A257295 (supersequences).

Programs

  • Magma
    [0] cat [&+Intseq(n) / #Intseq(n): n in [1..100000] | &+Intseq(n) mod #Intseq(n) eq 0];
    
  • PARI
    lista(nn) = {for (n=0, nn, if (n, d = digits(n), d = [0]); if (!( vecsum(d) % #d), print1(vecsum(d)/#d, ", ")););} \\ Michel Marcus, Apr 15 2017

Formula

a(n) = A007953(A061383(n)) / A055642(A061383(n)) for n >= 1.

A308335 Palindromic primes such that sum of digits = number of digits.

Original entry on oeis.org

11, 10301, 1201021, 3001003, 10000900001, 10002520001, 10013131001, 10111311101, 10301110301, 11012121011, 11020302011, 11030103011, 11100500111, 11120102111, 12000500021, 12110101121, 13100100131, 30000500003, 30011111003, 1000027200001, 1000051500001
Offset: 1

Views

Author

Bernard Schott, May 20 2019

Keywords

Comments

Every palindrome with an even number of digits is divisible by 11, so 11 is the only term of the sequence with an even number of digits.
Every palindrome with a number of digits which is a multiple of 3 also has a sum of digits which is divisible by 3, so there is no term with 3*k digits.
So, except 11 with 2 digits, the terms of this sequence must have a number of digits that belongs to A007310.
For n > 1, the middle digit of a(n) is odd. - Chai Wah Wu, Jun 30 2019

Examples

			3001003 is a term because it is a palindromic prime that has 7 digits and its sum of its digits is 7.
		

Crossrefs

Intersection of A000040 (primes), A002113 (palindromes) and A061384 (sum of digits = number of digits).
Intersection of A002385 and A061384.
Intersection of A069710 and A002113.

Programs

  • Mathematica
    f[n_] := If[n==2, {11}, If[Mod[(n-1) (n-5), 6]>0, {}, Block[{h = (n - 1)/2, L={}, p}, Do[p = Select[ Flatten[ Permutations /@ IntegerPartitions[ (n - c)/2, {h}, Range[0, 9]], 1], MemberQ[{1, 3, 7, 9}, Last[#]] &]; L = Join[L, Select[ FromDigits /@ (Flatten[{Reverse[#], c, #}] & /@ p), PrimeQ]], {c, 1, n-2, 2}]; Sort[L]]]]; Join @@ (f /@ Range[13]) (* Giovanni Resta, Jun 06 2019 *)
  • PARI
    isok(p) = isprime(p) && (d=digits(p)) && (Vecrev(d) == d) && (#d == vecsum(d)); \\ Michel Marcus, Jun 29 2019

Extensions

a(6)-a(21) from Jon E. Schoenfield, May 20 2019

A321771 Numbers whose digit product equals the number of their digits.

Original entry on oeis.org

1, 12, 21, 113, 131, 311, 1114, 1122, 1141, 1212, 1221, 1411, 2112, 2121, 2211, 4111, 11115, 11151, 11511, 15111, 51111, 111116, 111123, 111132, 111161, 111213, 111231, 111312, 111321, 111611, 112113, 112131, 112311, 113112, 113121, 113211, 116111, 121113
Offset: 1

Views

Author

Ivan Stoykov, Nov 21 2018

Keywords

Comments

Idea is similar to A061384, which uses addition instead of multiplication.

Examples

			12 has two digits, and their product is also 2, as 1*2=2.
		

Crossrefs

Cf. A061384.
Cf. A007954, A055642. Subsequence of A007602.
Subsequence of A052382 (zeroless numbers).

Programs

  • Mathematica
    Select[Range[1000000], Length[IntegerDigits[#]] == Times @@ IntegerDigits[#] &] (* Amiram Eldar, Nov 21 2018 *)
  • PARI
    isok(n) = my(d=digits(n)); vecprod(d) == #d; \\ Michel Marcus, Nov 22 2018

Extensions

More terms from Amiram Eldar, Nov 21 2018

A321999 Sum of digits of n minus the number of digits of n.

Original entry on oeis.org

0, 0, 1, 2, 3, 4, 5, 6, 7, 8, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7
Offset: 0

Views

Author

M. F. Hasler, Dec 07 2018

Keywords

Comments

Concerning 0 we use the convention that 0 has 0 digits, so a(0) = 0 - 0 = 0, a(1) = 1 - 1 = 0, and a(10) = 1 - 2 = -1 is the first negative terms of the sequence.

Examples

			a(0) = 0 - 0 = 0. (We consider 0 has 0 digits.)
a(1) = 1 - 1 = 0;
a(2) = 2 - 1 = 1, ...,
a(9) = 9 - 1 = 8. (General formula: a(10^k - 1) = 8*k.)
a(10) = 1 - 2 = -1. (General formula: a(10^k) = -k.)
a(11) = 1+1 - 2 = 0, ...,
a(19) = 1+9 - 2 = 8;
a(20) = 2+0 - 2 = 0. (General formula: a(m*10^k) = a(m) - k.)
a(29) = 2+9 - 2 = 9, ...,
a(99) = 9+9 - 2 = 16: cf. a(9);
a(100) = 1+0+0 - 3 = -2;
a(101) = 1+0+1 - 3 = -1;
a(102) = 1+0+2 - 3 = 0, ...,
a(109) = 1+0+9 - 3 = 7;
a(110) = 1+1+0 - 3 = -1, ...,
a(119) = 1+1+9 - 3 = 8, ...,
a(199) = 1+9+9 - 3 = 16,
a(200) = 2+0+0 - 3 = -1: cf. a(20), ...,
a(999) = 9+9+9 - 3 = 24: cf. a(9);
a(1000) = 1+0+0+0 - 4 = -3, ...,
a(1001) = 1+0+0+1 - 4 = -2, ....
		

Crossrefs

Cf. A007953 (digit sum of n), A004218 (ceiling(log_10(n))), A055642 (number of digits of n).
The zeroes of this sequence, except 0 itself, are in A061384.

Programs

  • Maple
    a:= n-> add(i, i=convert(n, base, 10))-length(n):
    seq(a(n), n=0..100);  # Alois P. Heinz, Dec 10 2018
  • Mathematica
    Table[(Plus@@IntegerDigits[n]) - Length[IntegerDigits[n]] + KroneckerDelta[n, 0], {n, 0, 99}] (* Alonso del Arte, Dec 07 2018 *)
    Table[Total[IntegerDigits[n]]-IntegerLength[n],{n,0,100}] (* Harvey P. Dale, Dec 27 2022 *)
  • PARI
    A321999(n)=sumdigits(n)-if(n,logint(n,10)+1)

Formula

a(n) = A007953(n) - A004218(n+1) = A007953(n) - A055642(n) for all n > 0. a(m*10^k) = a(m) - k for all m > 0, k >= 0, in particular:
a(10^k) = -k for all k >= 0. a(m) = m - 1 for 0 < m < 10.
a(n+1) = a(n) + 1 unless n = 9 (mod 10), in which case a(n+1) = a((n+1)/10).
a(10^k-1) = 8*k.

A354410 Numbers with as many zeros as the sum of their digits.

Original entry on oeis.org

10, 200, 1001, 1010, 1100, 3000, 10002, 10020, 10200, 12000, 20001, 20010, 20100, 21000, 40000, 100003, 100011, 100030, 100101, 100110, 100300, 101001, 101010, 101100, 103000, 110001, 110010, 110100, 111000, 130000, 200002, 200020, 200200, 202000, 220000
Offset: 1

Views

Author

Tamas Sandor Nagy, May 25 2022

Keywords

Comments

As is normal, there are no leading zeros. The places of k zeros and the nonzero digits that are partitions of k are combinatorial.
Numbers k such that A007953(k) = A055641(k). - Felix Fröhlich, May 26 2022

Crossrefs

Subsequence of A011540.
Cf. A007953 (sum of digits), A055641 (number of 0's).

Programs

  • Mathematica
    Select[Range[250000],DigitCount[#,10,0]==Total[IntegerDigits[#]]&] (* Harvey P. Dale, Jan 12 2023 *)
  • PARI
    isok(m) = my(d=digits(m)); vecsum(d) == #select(x->(x==0), d); \\ Michel Marcus, May 26 2022
    
  • PARI
    See Links section.
    
  • Python
    # after linked PARI by Rémy Sigrist
    base, vv, nb = 10, [0], 0
    def visit(v, s, z, r):
        global base, vv, nb
        if v and s==z:
            nb += 1
            if nb > len(vv): vv.append(len(vv))
            vv[nb-1] = v
        if s-z-r <= 0 and s-z+(base-1)*r >= 0:
            if v: visit(base*v, s, z+1, r-1)
            for d in range(1, base): visit(base*v+d, s+d, z, r-1)
    def auptod(digits): visit(0, 0, 0, digits); return sorted(set(vv))
    print(auptod(6)) # Michael S. Branicky, May 26 2022

A380725 Positive integers k whose sum of digits equals the square of their number of digits.

Original entry on oeis.org

1, 13, 22, 31, 40, 108, 117, 126, 135, 144, 153, 162, 171, 180, 207, 216, 225, 234, 243, 252, 261, 270, 306, 315, 324, 333, 342, 351, 360, 405, 414, 423, 432, 441, 450, 504, 513, 522, 531, 540, 603, 612, 621, 630, 702, 711, 720, 801, 810, 900, 1069, 1078, 1087, 1096, 1159, 1168, 1177, 1186, 1195
Offset: 1

Views

Author

Keywords

Comments

This is a finite sequence since if k is L digits long then its sum of digits is at most 9*L which is < L^2 for L > 9.

Crossrefs

Cf. A007953 (sum of digits), A061384.

Programs

  • Mathematica
    Select[Range[1200],DigitSum[#]==IntegerLength[#]^2&] (* James C. McMahon, Feb 18 2025 *)
  • PARI
    isok(k) = my(d=digits(k)); vecsum(d) == sqr(#d); \\ Michel Marcus, Feb 08 2025
    
  • Python
    def ok(n): return sum(map(int, s:=str(n))) == len(s)**2
    print([k for k in range(2000) if ok(k)]) # Michael S. Branicky, Feb 08 2025
  • Rust
    /// Is the term a valid entry in a380725
    pub fn a380725_predicate(mut k: usize) -> bool {
        let base = 10usize;
        let mut len = 0usize;
        let mut digit_sum = 0usize;
        while k > 0 {
            let digit = k.rem_euclid(base);
            k /= base;
            digit_sum += digit;
            len += 1;
        }
        digit_sum == len.pow(2u32)
    }
    
Previous Showing 11-16 of 16 results.