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

A115260 Prime numbers in the sequence of the absolute difference of the sum of digits in odd positions and the sum of digits in even positions of prime numbers.

Original entry on oeis.org

2, 3, 5, 7, 2, 7, 2, 3, 3, 2, 5, 2, 5, 2, 2, 3, 5, 7, 3, 3, 2, 2, 3, 3, 7, 5, 2, 3, 7, 2, 2, 5, 2, 5, 3, 3, 5, 7, 7, 5, 2, 5, 13, 3, 2, 3, 5, 3, 2, 7, 2, 5, 5, 7, 13, 3, 5, 2, 2, 7, 13, 3, 2, 3, 5, 17, 7, 13, 5, 3, 7, 17, 13, 7, 3, 7, 7, 2, 3, 5, 5, 2, 2, 7, 3, 3, 7, 2, 3, 7, 2, 3, 7, 2, 5, 5, 3, 2, 7, 3, 5, 7
Offset: 1

Views

Author

Keywords

Comments

Primes in the sequence A115259.

Examples

			a(37) = 3 because 37th prime = 157, (7+1) - 5 = 3, 3 is prime.
		

Crossrefs

Programs

  • Maple
    select(isprime,[seq(abs(sum(convert(ithprime(a),base,10)[2*i],i=1..nops(convert (ithprime(a),base,10))/2)-sum(convert(ithprime(a),base,10)[2*i+1],i=0..(nops (convert(ithprime(a),base,10))-1)/2)),a=1..N)]);

A193772 Nonnegative integers whose digital difference is 0.

Original entry on oeis.org

0, 11, 22, 33, 44, 55, 66, 77, 88, 99, 101, 110, 202, 211, 220, 303, 312, 321, 330, 404, 413, 422, 431, 440, 505, 514, 523, 532, 541, 550, 606, 615, 624, 633, 642, 651, 660, 707, 716, 725, 734, 743, 752, 761, 770, 808, 817, 826, 835, 844, 853, 862, 871, 880
Offset: 1

Views

Author

Dario Piazzalunga, Jan 02 2013

Keywords

Comments

The subsequence of multiples of 11 begins: 0, 11, 22, 33, 44, 55, 66, 77, 88, 99, 110, 220, 330, 440...
The subsequence of primes begins: 11, 101, 211, 431, 523, 541, 743, 761, 853, ... (see A156307).

Crossrefs

Programs

  • Maple
    V:= proc(n,s) # n-digits numbers with sum of digits s
         option remember; local i,k;
         `union`(seq(seq(map(t -> i*10^(n-1) + t, procname(k,s-i)),k=1..n-1),i=1..min(s,9)))
    end proc:
    for s from 0 to 9 do V(1,s) := {s} od:
    f:= proc(n) local s,k;
       `union`(seq(seq(map(t -> s*10^(n-1) + t, V(k,s)), k=1..n-1),s=1..9))
    end proc:
    sort(convert(`union`(seq(f(d),d=1..4)),list)); # Robert Israel, Nov 14 2024
  • Mathematica
    fQ[n_] := Module[{d = IntegerDigits[n]}, d[[1]] == Total[Rest[d]]]; Select[Range[0, 1000], fQ] (* T. D. Noe, Jan 02 2013 *)

Formula

If decimal expansion of n is x1 x2 ... xk then x1 - x2 - ... - xk = 0.

Extensions

Definition edited by Michel Marcus, Oct 26 2014

A241494 Pyramid Top Numbers: write the decimal digits of 'n' (a nonnegative integer) and take successive absolute differences ("pyramidalization"). The number at the top of the pyramid is 'a(n)'.

Original entry on oeis.org

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

Views

Author

Filipi R. de Oliveira, Apr 24 2014

Keywords

Comments

Through the so-called "pyramidalization" process (see A227876), a given nonnegative integer is expanded into its digits and transformed into a pyramid of successive absolute differences between digits. The present sequence is built only with the top number 'a(n)' generated from its correspondent nonnegative integer 'n'.

Examples

			If n=1735, a(n)=0:
______0 ------>a(n)
____2_:_2
__6_:_4_:_2
1_:_7_:_3_:_5
		

Crossrefs

Cf. A227876 for the pyramidalization process.
Cf. A076313 - its first 100 terms have the same absolute value, diverging afterwards; cf. A225693 and A055017 (A040997) for the same reason.

Programs

  • PARI
    a(n)=my(d=Vecsmall(digits(n))); forstep(k=#d-1,1,-1, for(j=1,k, d[j]=abs(d[j]-d[j+1]))); d[1] \\ Charles R Greathouse IV, Apr 24 2025

Formula

a(n)=n, if 0<=n<=9.
a(n)=|mod(n;10)-floor(n/10)|, if 10<=n<=99.

A274580 Digital difference of n: the most significant decimal digit of n minus the sum of the other digits.

Original entry on oeis.org

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

Views

Author

Felix Fröhlich, Jun 29 2016

Keywords

Comments

If A007953(n) is seen as giving the resulting sum when inserting "+" signs between the digits of n, then a(n) gives the resulting difference when inserting "-" signs between the digits of n.
a(n) = 0 if and only if n is in A193772.
Signed version of A040997.
First differs from A225693 at n = 101.
abs(a(n)) first differs from abs(A055017(n)) at n = 102.

Examples

			a(13) = 1 - 3 = -2.
a(74) = 7 - 4 = 3.
a(211) = 2 - 1 - 1 = 0.
		

Crossrefs

Programs

  • Mathematica
    Table[Fold[#1 - #2 &, IntegerDigits@ n], {n, 76}] (* Michael De Vlieger, Jun 30 2016 *)
    Table[-Differences[(Total/@TakeDrop[IntegerDigits[n],1])],{n,100}]//Flatten (* Harvey P. Dale, Dec 27 2022 *)
  • PARI
    diffdigits(n) = my(d=digits(n), dd=d[1]); for(k=2, #d, dd=dd-d[k]); dd
    a(n) = diffdigits(n)

Formula

a(n) = A000030(n) - A007953(A217657(n)).
Previous Showing 11-14 of 14 results.