login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A263172
Nonpalindromic positive integers whose digits can be rearranged to form a palindrome, after evaluation.
1
10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 112, 113, 114, 115, 116, 117, 118, 119, 122, 133, 144, 155, 166, 177, 188, 199, 200, 211, 220, 221, 223, 224, 225, 226, 227, 228, 229, 233, 244, 255, 266, 277, 288, 299, 300, 311, 322, 330
OFFSET
1,1
COMMENTS
Called Dennis numbers as a tribute to user Dennis for winning the robbers' part of The Programming Language Quiz of the Programming Puzzles & Code Golf Stack Exchange website.
Number of d-digit terms for d in [1..8]: [0, 9, 162, 846, 10044, 55548, 608472, 3911256]. - Jon E. Schoenfield, Oct 11 2015
LINKS
Programming Puzzles & Code Golf Stack Exchange, Generate Dennis Numbers, Sep 11 2015.
EXAMPLE
10 is in the sequence since rearranging the 1 and 0 gives the digit string "01", which evaluates to 1, which is a palindrome.
16612 is in the sequence since its digits can be rearranged (as 16261 or 61216) to form a palindrome.
212 is not in the sequence since it is already palindromic.
Since all one-digit numbers are already palindromic, they are not in the sequence.
MATHEMATICA
palQ[n_] := Block[{d = IntegerDigits@ n}, d == Reverse@ d]; Select[Range@ 330, And[! palQ@ #, AnyTrue[FromDigits /@ Permutations@ IntegerDigits@ #, palQ]] &] (* Michael De Vlieger, Nov 03 2015, Version 10 *)
PROG
(Rust) fn d(mut i:u64)->(u64, i32){for n in 1..{let mut o=0; if n.to_string()==n.to_string().chars().rev().collect::<String>(){continue}let mut s=n.to_string().into_bytes(); for a in 0..s.len(){for b in a+1..s.len(){s.swap(a, b); {let t=s.iter().skip_while(|&x|*x==48).collect::<Vec<&u8>>(); if t.iter().cloned().rev().collect::<Vec<&u8>>()==t{o+=1}}s.swap(a, b); }}if o>0{i-=1; if i<1{return(n, o)}}}(0, 0)} // Program written by Programming Puzzles & Code Golf Stack Exchange user "Doorknob" on September 12, 2015
(Python)
def c(s): return sum(s.count(d)&1 for d in set(s)) == len(s)&1
def ok(n): s = str(n); return s != s[::-1] and c(s.replace("0", ""))
print([k for k in range(331) if ok(k)]) # Michael S. Branicky, Jul 25 2022
CROSSREFS
Cf. A002113.
Sequence in context: A096092 A109597 A194233 * A008592 A158814 A359173
KEYWORD
nonn,base
AUTHOR
Matthew McCaskill, Oct 11 2015
STATUS
approved