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.

A307629 Let decimal expansion of n be d_1 d_2 ... d_k; a(n) = Sum_{i=1..k-1} Sum_{j=i+1..k} (d_i + d_j).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 8, 9, 10, 11, 12, 13, 14, 15, 16, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 2, 4, 6
Offset: 0

Views

Author

N. J. A. Sloane, Apr 19 2019

Keywords

Comments

More than the usual number of terms are shown in order to distinguish this from related sequences.
Starts to differ from A093882 at A093882(101)=22 <> a(101)=4. - R. J. Mathar, May 06 2019

Examples

			For n<10 there is only one decimal digit so a(n)=0.
a(102) = 1+0 + 1+2 + 0+2 = 6.
		

Crossrefs

Suggested by A307560.

Programs

  • Maple
    a:= n-> (d-> (nops(d)-1)*add(i, i=d))(convert(n, base, 10)):
    seq(a(n), n=0..120);  # Alois P. Heinz, Apr 19 2019
  • Mathematica
    Array[Total@ Flatten@ Subsets[IntegerDigits@ #, {2}] &, 103, 0] (* Michael De Vlieger, Apr 19 2019 *)

Formula

From Alois P. Heinz, Apr 19 2019: (Start)
a(n) = A007953(n) * (A055642(n)-1).
a(n) = A110805(n) - A007953(n). (End)

A109133 Numbers k such that (sum of digits)*(number of digits) + 1 is prime.

Original entry on oeis.org

1, 2, 4, 6, 10, 11, 12, 14, 15, 17, 18, 20, 21, 23, 24, 26, 27, 29, 30, 32, 33, 35, 36, 38, 41, 42, 44, 45, 47, 50, 51, 53, 54, 56, 59, 60, 62, 63, 65, 68, 69, 71, 72, 74, 77, 78, 80, 81, 83, 86, 87, 90, 92, 95, 96, 99, 101, 103, 105, 109, 110, 112, 114, 118, 121, 123, 127
Offset: 1

Views

Author

Jason Earls, Aug 17 2005

Keywords

Comments

By Dirichlet's theorem on primes in arithmetic progressions, for any positive integer k this sequence has infinitely many terms of the form k*10^m. - Robert Israel, Dec 19 2021

Examples

			1234 is a term because 4*(1+2+3+4)+1 = 41.
		

Crossrefs

Cf. A110805.

Programs

  • Maple
    filter:= proc(n) local L;
      L:= convert(n,base,10);
      isprime(convert(L,`+`)*nops(L)+1)
    end proc:
    select(filter, [$1..200]); # Robert Israel, Dec 19 2021
  • Mathematica
    Select[Range[130],PrimeQ[Total[IntegerDigits[#]]IntegerLength[ #]+ 1]&] (* Harvey P. Dale, Jul 12 2011 *)
  • Python
    from sympy import isprime
    def ok(n): s = str(n); return isprime(sum(map(int, s))*len(s) + 1)
    print([k for k in range(128) if ok(k)]) # Michael S. Branicky, Dec 19 2021

A110806 Numbers n such that sum of the digits as well as number of digits divides n.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 18, 20, 24, 30, 36, 40, 42, 48, 50, 54, 60, 70, 72, 80, 84, 90, 102, 108, 111, 114, 117, 120, 126, 132, 135, 144, 150, 153, 156, 162, 171, 180, 192, 195, 198, 201, 204, 207, 210, 216, 222, 225, 228, 234, 240, 243, 252
Offset: 1

Views

Author

Amarnath Murthy, Aug 14 2005

Keywords

Examples

			48 is a member as sum of the digits 4+8 = 12 and number of digits 2 both divide 48.
		

Crossrefs

Cf. A110805.

Programs

  • Mathematica
    Select[Range[260], IntegerQ[ #/Sum[DigitCount[ # ][[i]]*i, {i, 1, 9}]] && IntegerQ[ #/Floor[Log[10, # ] + 1]] &] (* Stefan Steinerberger, Mar 18 2006 *)
    Select[Range[300],And@@Divisible[#,{Total[IntegerDigits[#]], IntegerLength[ #]}]&] (* Harvey P. Dale, May 10 2015 *)

Extensions

Corrected and extended by Stefan Steinerberger, Feb 17 2006

A281724 Numbers k with the property that (sum of digits of k) times (number of digits of k) equals (sum of {each digit of k} raised to the power {number of digits in k}).

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 20, 22, 102, 120, 201, 210
Offset: 1

Views

Author

Keywords

Comments

Numbers with the property that q-p = 0, where p = (sum of digits of k) times (number of digits of k) (A110805) and q = (sum of {each digit of k} raised to the power {number of digits in k}) (A101337).
From David Consiglio, Jr., Jan 29 2017: (Start)
The sequence is finite and 210 is the last term. Proof:
1. Let Y = length(k).
2. The maximum value of digit_sum(k) is 9Y.
3. Since p = Y*digit_sum(k), p has a maximum value of 9Y^2.
4. 2^Y > 9Y^2 for all Y > 9. Therefore q > p for all numbers longer than 9 digits that contain any digits > 1.
a. Example: 1,000,000,002. q = 1^5 + 8*0^5 + 2^10 = 1025. The largest p value for a 10-digit number would be for 9,999,999,999 which has p = 10*(9*10) = 900. Since q > all possible p values at this size, any term of this sequence must either have fewer than 10 digits or contain only 0's and 1's as digits.
5. Now we can consider only numbers with 0 and 1 digits.
6. Let Z = number of 1 digits in a number k.
7. q = Z because q = Z*1^Y + (Y-Z)*0^Y = Z.
8. p = YZ because the sum of the digits is equal to the number of 1's.
9. Z = YZ only in the case of Y = 1. Thus, the only term of this sequence that contains only 0's and 1's has a length of only 1 digit. Thus, k = 1 is in this sequence.
10. Therefore a candidate number must have fewer than 10 digits if it contains a digit 2 or larger, and must have fewer than 2 digits if it does not. All numbers in this range have been checked, and no additional values of k with q = p have been found.
Thus the sequence is finite. (End)

Examples

			    9 is a term because             9^1 = 1*(9);
   20 is a term because       2^2 + 0^2 = 2*(2 + 0);
  210 is a term because 2^3 + 1^3 + 0^3 = 3*(2 + 1 + 0).
		

Crossrefs

Programs

  • Mathematica
    W = Array[Total[IntegerDigits[#]^IntegerLength[#]]&, 100]-Table[IntegerLength[n] * Total[IntegerDigits[n]], {n, 100}]; Flatten[Position[W,0]]
Showing 1-4 of 4 results.