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

A135643 Straight-line numbers > 99.

Original entry on oeis.org

111, 123, 135, 147, 159, 210, 222, 234, 246, 258, 321, 333, 345, 357, 369, 420, 432, 444, 456, 468, 531, 543, 555, 567, 579, 630, 642, 654, 666, 678, 741, 753, 765, 777, 789, 840, 852, 864, 876, 888, 951, 963, 975, 987, 999, 1111, 1234
Offset: 1

Views

Author

Omar E. Pol, Nov 30 2007, Dec 09 2008, Nov 14 2009

Keywords

Comments

Numbers with more than two digits whose digits are in arithmetic progression. The structure of digits represents a straight line. In the graphic representation the points are connected by imaginary line segments. For a(1) to a(45) this sequence is equal to A034840. Each term of this sequence that is greater than 9876543210 is a repdigit number (A010785).
Note that the sequence of straight-line numbers starts: 10, 11, 12, ..., 98, 99, 111, 123, ... All 2-digit numbers are straight-line numbers, but here the numbers < 100 are omitted. - Omar E. Pol, Nov 14 2009

Examples

			The number 3579 is a straight-line number:
  . . . 9
  . . . .
  . . 7 .
  . . . .
  . 5 . .
  . . . .
  3 . . .
  . . . .
  . . . .
  . . . .
		

Crossrefs

Cf. A247616 (subsequence).

Programs

  • Haskell
    a135643 n = a135643_list !! (n-1)
    a135643_list = filter f [100..] where
       f x = all (== 0) ws where
             ws = zipWith (-) (tail vs) vs
             vs = zipWith (-) (tail us) us
             us = map (read . return) $ show x
    -- Reinhard Zumkeller, Sep 21 2014
    
  • Mathematica
    Select[Range[100,1300],Length[Union[Differences[IntegerDigits[#]]]]==1&] (* Harvey P. Dale, May 09 2012 *)
  • PARI
    is(n) = my (d=digits(n), cvx=0, ccv=0, str=0); for (i=1, #d-2, my (x=d[i]+d[i+2]-2*d[i+1]); if (x>0, cvx++, x<0, ccv++, str++)); return (cvx==0 && ccv==0 && str>0) \\ Rémy Sigrist, Aug 09 2017
    
  • Python
    from itertools import count, islice
    def agen():
        progressions = ["".join(map(str, range(i, j+1, d))) for i in range(10) for d in range(1, 10-i) for j in range(i+2*d, 10)]
        s =  [p for p in progressions if p[0] != "0"]          # up
        s += [p[::-1] for p in progressions]                   # down
        s += [d*i for d in "123456789" for i in range(3, 11)]  # flat
        yield from sorted(set(int(w) for w in s))
        yield from (int(f*d) for d in count(11) for f in "123456789")
    print(list(islice(agen(), 178))) # Michael S. Branicky, Aug 03 2022

A231588 Primes with decimal digits in arithmetic progression mod 10.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 109, 173, 197, 307, 383, 593, 727, 739, 937, 2963, 4567, 4703, 5791, 7159, 8147, 9371, 10987, 15937, 19753, 37159, 52963, 53197, 58147, 71593, 72727, 73951, 76543
Offset: 1

Views

Author

Paul Tek, Nov 11 2013

Keywords

Comments

This sequence contains straight-line primes (A167847).
a(216) has 1012 digits. - Michael S. Branicky, Aug 05 2022

Examples

			(7,2,7,2,7,...) is an arithmetic progression mod 10, hence the prime number 72727 appears in this sequence.
(7,6,5,4,3,...) is an arithmetic progression mod 10, hence the prime number 76543 appears in this sequence.
		

Crossrefs

Cf. A167847.

Programs

  • Mathematica
    Select[Prime[Range[PrimePi[76543]]], Length[Union[Mod[Differences[IntegerDigits[#]], 10]]] <= 1 &]
  • PARI
    See Link section.
    
  • Python
    from sympy import isprime
    from itertools import count, islice
    def bgen():
        yield from [2, 3, 5, 7]
        yield from (int("".join(str((s0+i*r)%10) for i in range(d))) for d in count(2) for s0 in range(1, 10) for r in range(-s0, 10-s0))
    def agen(): yield from filter(isprime, bgen())
    print(list(islice(agen(), 52))) # Michael S. Branicky, Aug 05 2022

A302907 For any number m with decimal digits (d_1, ..., d_k), let s(m) be the area of the convex hull of the set of points { (i, d_i), i = 1..k }; a(n) = 2 * s(prime(n)) (where prime(n) denotes the n-th prime number).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 8, 10, 2, 4, 4, 2, 4, 2, 8, 2, 8, 4, 10, 4, 14, 16, 14, 10, 8, 1, 1, 5, 7, 1, 5, 5, 7, 1, 7, 1, 11, 5, 13, 11, 13, 10, 2, 4, 8, 2, 4, 2, 4, 4, 2, 2, 8, 2, 10, 4, 8, 5, 13, 11, 1
Offset: 1

Views

Author

Rémy Sigrist, Dec 16 2018

Keywords

Comments

As in A167847 and in similar sequences, we map the digits of a number to a set of points and consider its graphical and geometrical properties.

Examples

			For n = 26:
- the 26th prime number is 101,
- the corresponding convex hull is as follows:
   (1,1) +-----+ (3,1)
          \   /
           \ /
            + (2,0)
- it has area 1, hence a(26) = 2.
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

a(n) = 0 iff the n-th prime number belongs to A167847.
Showing 1-3 of 3 results.