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

A053178 Numbers ending in 1 which are not prime.

Original entry on oeis.org

1, 21, 51, 81, 91, 111, 121, 141, 161, 171, 201, 221, 231, 261, 291, 301, 321, 341, 351, 361, 371, 381, 391, 411, 441, 451, 471, 481, 501, 511, 531, 551, 561, 581, 591, 611, 621, 651, 671, 681, 711, 721, 731, 741, 771, 781, 791, 801, 831, 841, 851, 861, 871
Offset: 1

Views

Author

Enoch Haga, Feb 29 2000

Keywords

Comments

Nonprime numbers of the form k*10+1. - Juri-Stepan Gerasimov, Oct 14 2009

Examples

			a(4) = 91 may look prime to some, but is composite.
		

Crossrefs

Programs

  • Maple
    remove(isprime, [10*j+1$j=0..99])[];  # Alois P. Heinz, Jan 21 2021
  • PARI
    isok(n) = ((n % 10) == 1) && (! isprime(n)) \\ Michel Marcus, Jul 26 2013
    
  • Python
    from sympy import isprime
    def aupto(lim): return [m for m in range(1, lim+1, 10) if not isprime(m)]
    print(aupto(871)) # Michael S. Branicky, Jan 21 2021

A358154 a(n) is the smallest composite number obtained by appending one or more 1's to n.

Original entry on oeis.org

111, 21, 3111, 411, 51, 611, 711, 81, 91, 1011, 111, 121, 1311, 141, 15111, 161, 171, 18111, 1911, 201, 21111, 221, 231, 24111, 2511, 261, 27111, 2811, 291, 301, 3111, 321, 3311, 341, 351, 361, 371, 381, 391, 4011, 411, 42111, 4311, 441, 451, 4611, 471, 481, 4911, 501, 511, 5211, 531, 5411
Offset: 1

Views

Author

Gleb Ivanov, Nov 01 2022

Keywords

Comments

a(n) is either 10*n+1, 100*n+11 or 1000*n+111, because at least one of these is divisible by 3. - Robert Israel, Nov 01 2022
Actually: exactly one of these is divisible by 3. Almost all terms are a(n) = 10n + 1: this is the case for about (k-1)/k of the terms up to 10^k (i.e., 69% ~ 2/3 up to 10^3, 76% = 3/4 up to 10^4, 80% = 4/5 up to 10^5, 83% = 5/6 up to 10^6). - M. F. Hasler, Nov 03 2022

Crossrefs

Programs

  • Maple
    f:= proc(n) local x;
       x:= n;
       do
         x:= 10*x+1;
         if not isprime(x) then return x fi;
       od
    end proc:
    map(f, [$1..100]); # Robert Israel, Nov 01 2022
  • Mathematica
    a[n_] := NestWhile[10*# + 1 &, 10*n + 1, ! CompositeQ[#] &]; Array[a, 54] (* Amiram Eldar, Nov 01 2022 *)
  • PARI
    a(n) = my(d=digits(n), m); if (!isprime(n), d = concat(d, 1)); while(isprime(m=fromdigits(d)), d=concat(d, 1)); m; \\ Michel Marcus, Nov 01 2022
  • Python
    from sympy import isprime
    def A358154(n):
        t = str(n)+'1'
        while isprime(int(t)):t=t+'1'
        return int(t)
    print([A358154(i) for i in range(1, 100)])
    
Showing 1-2 of 2 results.